From patchwork Sun Mar 15 23:57:14 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: 11439517 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 8409C92A for ; Mon, 16 Mar 2020 00:36:33 +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 5384520674 for ; Mon, 16 Mar 2020 00:36:33 +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="CPX7e0nw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5384520674 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]:60792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDdk8-0000gT-5A for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Mar 2020 20:36:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44554) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDd99-0003Yc-Ag for qemu-devel@nongnu.org; Sun, 15 Mar 2020 19:58:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDd98-0001Yv-7C for qemu-devel@nongnu.org; Sun, 15 Mar 2020 19:58:19 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:24304 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jDd98-0001XM-33 for qemu-devel@nongnu.org; Sun, 15 Mar 2020 19:58:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584316697; 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=rlwvTfWdlege7GScVPmVC823d5hwqV7V8ZFGgb3kNWU=; b=CPX7e0nw4luZQV3/DU88h2cVhsOhTV8jVYnHc7Gb+QnR6V6VPr7dLRWHZkVoX0nlLHot0U RRY0Cskx9I/kNcTEfdLuToqT4xlaF2uRZVyyna0VbtTV5MOKyv02tNzuDVM63fuolrwH0f Kw6gDXpwHFLxtq93B5Z879FzbKO2T4E= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-346-FWaZqvtVNQaFWOtcLlxFlA-1; Sun, 15 Mar 2020 19:58:16 -0400 X-MC-Unique: FWaZqvtVNQaFWOtcLlxFlA-1 Received: by mail-wr1-f70.google.com with SMTP id o9so8139312wrw.14 for ; Sun, 15 Mar 2020 16:58:16 -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=LM2hbE7ibTJgNB7j2Une2S4sO88fnFzm04CEg7ESeAA=; b=RX5mZORo47QZA4GnlwEY4K7ZKPj4aG61+Q1h4Kdbn44MivdPxML/KWessOr/4B1789 ar9MrN7LhOwLQapHzRzWC6/8bIJof+7c0S3hm3sLkR9yjkj8+c2EbuPleISk6pH8l6Bv jshD7PzxbB3Vkoaq8xcUbQ78wN9EfT5Ky0Ld8j3OjP3Fe/1d+cenq+CVNzY1yI2XOr1s dIN0O6cax9Tlyaz7CnSwA2xFCisy2EIlbCekv37re7g2AVP3ZdRNhsLhvrS0iN4PbXCd mq1qd+SnfnxZC0BS81eRcGlvRVesgPnFwly2J8BmX6rSwVPQwmM50L4fFP9vEZ1h60y/ cgow== X-Gm-Message-State: ANhLgQ0lwHshEiKAiMLn0jDRESxsH5XXJ5GFYHmRPpKhsxPESPDrnZya 5l16p5e5zqN0V6BmRcNK0sZM9B2ppmlVGhpO/ebK7YEezBF3+HT03VFb+cffHI8QNneiOqUMASs K6IWuLI/s4bW51Vc= X-Received: by 2002:a1c:9658:: with SMTP id y85mr15033361wmd.63.1584316694981; Sun, 15 Mar 2020 16:58:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvF+IgZfR7MEY3aZqP73j5Vu/iWzP7jnsDEv7kURy9sfgCgbdaobwONGaF31LtfOgY9OJtv5Q== X-Received: by 2002:a1c:9658:: with SMTP id y85mr15033342wmd.63.1584316694832; Sun, 15 Mar 2020 16:58:14 -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 s7sm16458227wri.61.2020.03.15.16.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Mar 2020 16:58:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 10/12] target/i386: Restrict CpuClass::get_crash_info() to system-mode Date: Mon, 16 Mar 2020 00:57:14 +0100 Message-Id: <20200315235716.28448-11-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.120 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é --- target/i386/cpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 92fafa2659..a84553e50c 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6778,6 +6778,7 @@ static void x86_cpu_register_feature_bit_props(X86CPU *cpu, x86_cpu_register_bit_prop(cpu, name, w, bitnr); } +#if !defined(CONFIG_USER_ONLY) static GuestPanicInformation *x86_cpu_get_crash_info(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); @@ -6821,6 +6822,7 @@ static void x86_cpu_get_crash_info_qom(Object *obj, Visitor *v, errp); qapi_free_GuestPanicInformation(panic_info); } +#endif /* !CONFIG_USER_ONLY */ static void x86_cpu_initfn(Object *obj) { @@ -6866,8 +6868,10 @@ static void x86_cpu_initfn(Object *obj) x86_cpu_get_unavailable_features, NULL, NULL, NULL, &error_abort); +#if !defined(CONFIG_USER_ONLY) object_property_add(obj, "crash-information", "GuestPanicInformation", x86_cpu_get_crash_info_qom, NULL, NULL, NULL, NULL); +#endif for (w = 0; w < FEATURE_WORDS; w++) { int bitnr; @@ -7180,7 +7184,6 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) cc->cpu_exec_interrupt = x86_cpu_exec_interrupt; #endif cc->dump_state = x86_cpu_dump_state; - cc->get_crash_info = x86_cpu_get_crash_info; cc->set_pc = x86_cpu_set_pc; cc->synchronize_from_tb = x86_cpu_synchronize_from_tb; cc->gdb_read_register = x86_cpu_gdb_read_register; @@ -7191,6 +7194,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) cc->asidx_from_attrs = x86_asidx_from_attrs; cc->get_memory_mapping = x86_cpu_get_memory_mapping; cc->get_phys_page_attrs_debug = x86_cpu_get_phys_page_attrs_debug; + cc->get_crash_info = x86_cpu_get_crash_info; cc->write_elf64_note = x86_cpu_write_elf64_note; cc->write_elf64_qemunote = x86_cpu_write_elf64_qemunote; cc->write_elf32_note = x86_cpu_write_elf32_note;