From patchwork Fri May 22 17:25:07 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: 1296417 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NuCItxMI; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 49TD8J1Ynpz9sSF for ; Sat, 23 May 2020 03:32:32 +1000 (AEST) Received: from localhost ([::1]:58394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jcBX3-0007ry-Rr for incoming@patchwork.ozlabs.org; Fri, 22 May 2020 13:32:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47790) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jcBQt-0005ye-GM for qemu-devel@nongnu.org; Fri, 22 May 2020 13:26:07 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:36327 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jcBQr-0002Az-RB for qemu-devel@nongnu.org; Fri, 22 May 2020 13:26:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590168364; 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=njMVcw9nzb67by0KnDJJ20QJffO3+OPEhMt5z5q8uy0=; b=NuCItxMIcAEpTineeNVzcOJzxvowhhQA+sSIBdcK29OtJ7fj9Vg+fDmV/qgXbmp5tRzIy4 rcuYIxw8mWU9osnWp55dkqR6NwiZcFq3+EWKNGguLvWuOZFhiYCSel61X3OK5+pl9MDwFd DM9LkbsXu7QqdXKoBdRIk0wsGdSsOSY= 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-425-nDi3pFOONL253WaGctjbaw-1; Fri, 22 May 2020 13:26:03 -0400 X-MC-Unique: nDi3pFOONL253WaGctjbaw-1 Received: by mail-wr1-f70.google.com with SMTP id n9so4629374wru.20 for ; Fri, 22 May 2020 10:26:02 -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=njMVcw9nzb67by0KnDJJ20QJffO3+OPEhMt5z5q8uy0=; b=Zili8TGHWsK1g/iQrJbxJHUv4FRv3LkKQtlikt0QiJHowspldWOE5f4WpRh90JpQ2U 6f6LPRoRr5rJIXEuqVHzJDyqy2w03EyVWBqeGl05QNvEl+3pXXDQjRbw3NhnfTN0tnmk 7Z8aF+rAD+oTp0NCrH8GH5N2TzXefykvnInAOodSB1lzNdnR6fevw1fhWNcVRuMO2Bvn D2V/NwylXYx/uAnimFc54nNLXme/Oceb6AQV7AC/i1V91jt6ipbev16RNsLSKMEyJQ4G Q4xBFUjGov0tXavsLUCIPODRIFxO5NifbzorB9AHkkxWl4ZOmWVUM/8kt6E59JCjFkpV 6r1w== X-Gm-Message-State: AOAM531A9F38nPvL+O7hMGvG4AikcowILyoZW/w2UvzEE8J1r4azxN2m tETD9lJIFVdUJfSOXe0mtnFPmKKP4hwYVKkTwMmi4DPKaaCQyYyulvKnlZ9vW/aZZFLS8b/vfwL cbhU4Q9IHBhoKkvI= X-Received: by 2002:a05:6000:1187:: with SMTP id g7mr4295123wrx.54.1590168361859; Fri, 22 May 2020 10:26:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTWSYeq5PO/H81uw1oH1eRVrb4JRSLJ7bWz8JXtUZLG7fdkypR0KgHWeUhNA/fdldKY/EEVQ== X-Received: by 2002:a05:6000:1187:: with SMTP id g7mr4295098wrx.54.1590168361652; Fri, 22 May 2020 10:26:01 -0700 (PDT) Received: from localhost.localdomain (17.red-88-21-202.staticip.rima-tde.net. [88.21.202.17]) by smtp.gmail.com with ESMTPSA id 81sm10811338wme.16.2020.05.22.10.26.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 May 2020 10:26:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v4 10/13] target/i386: Restrict CpuClass::get_crash_info() to system-mode Date: Fri, 22 May 2020 19:25:07 +0200 Message-Id: <20200522172510.25784-11-philmd@redhat.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200522172510.25784-1-philmd@redhat.com> References: <20200522172510.25784-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=207.211.31.81; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/22 11:12:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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: qemu-riscv@nongnu.org, Eduardo Habkost , Sagar Karandikar , David Hildenbrand , Bastian Koppelmann , Cornelia Huck , Richard Henderson , Laurent Vivier , qemu-s390x@nongnu.org, Alistair Francis , Paolo Bonzini , Palmer Dabbelt , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Richard Henderson Reviewed-by: Laurent Vivier Tested-by: Laurent Vivier 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 7a4a8e3847..dd31c1de5f 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6843,6 +6843,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); @@ -6886,6 +6887,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) { @@ -6932,8 +6934,10 @@ static void x86_cpu_initfn(Object *obj) x86_cpu_get_unavailable_features, NULL, NULL, NULL); +#if !defined(CONFIG_USER_ONLY) object_property_add(obj, "crash-information", "GuestPanicInformation", x86_cpu_get_crash_info_qom, NULL, NULL, NULL); +#endif for (w = 0; w < FEATURE_WORDS; w++) { int bitnr; @@ -7245,7 +7249,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; @@ -7256,6 +7259,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;