From patchwork Sun Mar 15 23:57:16 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: 11439499 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 407A11392 for ; Mon, 16 Mar 2020 00:08:09 +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 0BC32205C9 for ; Mon, 16 Mar 2020 00:08:09 +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="YnBHgvM5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0BC32205C9 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]:60562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdId-0006xz-V3 for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Mar 2020 20:08:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45339) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDd9i-0003oH-Hi for qemu-devel@nongnu.org; Sun, 15 Mar 2020 19:58:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDd9f-00045a-BM for qemu-devel@nongnu.org; Sun, 15 Mar 2020 19:58:53 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:21648 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 1jDd9f-00043b-6n for qemu-devel@nongnu.org; Sun, 15 Mar 2020 19:58:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584316730; 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=QIpLs9OctqCuKos7ZiUUzN2VPTQfmDm1r4MzNZjOnFQ=; b=YnBHgvM5k64AoOpqfTBJRQTWy8sYp96qEOVsYs7pOfEGhI/d7l3snQ92C1AQ33s7WPzd+p vrgaO6r6L03xgavih1A6c36zr8eHyN76Rmu2yPezglMdkvH4PQNoATwGkzqNyULtMQ9+b9 gomih7Gs+063d90VWytck6MgGMjzAKE= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-412-UK6YRZgBP-iVjpdHgUNKVw-1; Sun, 15 Mar 2020 19:58:27 -0400 X-MC-Unique: UK6YRZgBP-iVjpdHgUNKVw-1 Received: by mail-wm1-f69.google.com with SMTP id a23so5014557wmm.8 for ; Sun, 15 Mar 2020 16:58:27 -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=uY3oKl3eAdfHR0fz6PQrp/bV3LAJ2aY0H7iSeuB//0A=; b=YmS9XcQVI41JENx9F0fxM6nCQNaqfde5vJNub4XbsfYGYyjEIWCYTZP6slD0qQNlsO Sjzqmvdb6t7D/CQlm+cX3YZOZSQulXMOBseoaxW2L+X0NEHCgboIn/IVOPJLS0jv1g66 WqCn8qt832iEvDVaRRoRARpkT9utkvOsu3jUDsOMjmO53zK/oZXwslZq2XmzVyvBul6e DJNZCfypScvtJoO1bV74aGpC34jP4GmZtOl7tGRbpuhJUw+6sTgZtPIoibv44lyawy/B nhtY8Z1a1ndvluZdjMPfekLl/kRRHyuPdmEp+ebiVT58gCZ7qW7pcURBMUfJEFQmNwGO Jm4A== X-Gm-Message-State: ANhLgQ2AgZMQtBi53d1Q20w0quK9hSmcrwAAEzH50l9hNyY3UAP92Kio Idr+PfkcPTipY/Y0DH6X0l9vMFQZfgByxoLpHzapd3n1Gc3ITqF3EWg1v9ppxY2IyRyhhUJN1s5 z3zlqkPcH5DATazc= X-Received: by 2002:a1c:80d3:: with SMTP id b202mr9850983wmd.16.1584316706062; Sun, 15 Mar 2020 16:58:26 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuFSZ8a1xPKoAUJpUTBbcg8KqBFak+jSDu0iodws8OyRXOif1AhfUVCzYL+udH7kIdblowc1w== X-Received: by 2002:a1c:80d3:: with SMTP id b202mr9850950wmd.16.1584316705755; Sun, 15 Mar 2020 16:58:25 -0700 (PDT) Received: from localhost.localdomain (191.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.191]) by smtp.gmail.com with ESMTPSA id p10sm90850559wrx.81.2020.03.15.16.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 16:58:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 12/12] hw/core: Restrict CpuClass::get_crash_info() to system-mode Date: Mon, 16 Mar 2020 00:57:16 +0100 Message-Id: <20200315235716.28448-13-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200315235716.28448-1-philmd@redhat.com> References: <20200315235716.28448-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: Eduardo Habkost , Cornelia Huck , Richard Henderson , Laurent Vivier , qemu-s390x@nongnu.org, Alistair Francis , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 7 ++++++- hw/core/cpu.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 73e9a869a4..48ab5ec3ed 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -492,6 +492,8 @@ bool cpu_paging_enabled(const CPUState *cpu); void cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list, Error **errp); +#if !defined(CONFIG_USER_ONLY) + /** * cpu_write_elf64_note: * @f: pointer to a function that writes memory to a file @@ -541,6 +543,8 @@ int cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu, */ GuestPanicInformation *cpu_get_crash_info(CPUState *cpu); +#endif /* !CONFIG_USER_ONLY */ + /** * CPUDumpFlags: * @CPU_DUMP_CODE: @@ -634,7 +638,8 @@ static inline int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs) } return ret; } -#endif + +#endif /* CONFIG_USER_ONLY */ /** * cpu_list_add: diff --git a/hw/core/cpu.c b/hw/core/cpu.c index fe65ca62ac..debdd7e670 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -209,6 +209,7 @@ static bool cpu_common_exec_interrupt(CPUState *cpu, int int_req) return false; } +#if !defined(CONFIG_USER_ONLY) GuestPanicInformation *cpu_get_crash_info(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); @@ -219,6 +220,7 @@ GuestPanicInformation *cpu_get_crash_info(CPUState *cpu) } return res; } +#endif void cpu_dump_state(CPUState *cpu, FILE *f, int flags) {