From owner-svn-src-all@freebsd.org Tue Aug 15 14:03:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30126DD5E2F; Tue, 15 Aug 2017 14:03:28 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED40D7105C; Tue, 15 Aug 2017 14:03:27 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7FE3Rec075953; Tue, 15 Aug 2017 14:03:27 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7FE3R9P075952; Tue, 15 Aug 2017 14:03:27 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201708151403.v7FE3R9P075952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 15 Aug 2017 14:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322542 - head/sys/boot/efi/loader/arch/amd64 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/boot/efi/loader/arch/amd64 X-SVN-Commit-Revision: 322542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Aug 2017 14:03:28 -0000 Author: tsoome Date: Tue Aug 15 14:03:26 2017 New Revision: 322542 URL: https://svnweb.freebsd.org/changeset/base/322542 Log: loader.efi: repace XXX with real comments in trap.c There are two missing comments marked as XXX in trap.c, fix this. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D12035 Modified: head/sys/boot/efi/loader/arch/amd64/trap.c Modified: head/sys/boot/efi/loader/arch/amd64/trap.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/trap.c Tue Aug 15 14:02:57 2017 (r322541) +++ head/sys/boot/efi/loader/arch/amd64/trap.c Tue Aug 15 14:03:26 2017 (r322542) @@ -84,7 +84,11 @@ void report_exc(struct trapframe *tf) { - /* XXX using printf */ + /* + * printf() depends on loader runtime and UEFI firmware health + * to produce the console output, in case of exception, the + * loader or firmware runtime may fail to support the printf(). + */ printf("====================================================" "============================\n"); printf("Exception %u\n", tf->tf_trapno); @@ -122,7 +126,13 @@ prepare_exception(unsigned idx, uint64_t my_handler, ist_use_table[fw_idt_e->gd_ist]++; loader_idt_e->gd_looffset = my_handler; loader_idt_e->gd_hioffset = my_handler >> 16; - loader_idt_e->gd_selector = fw_idt_e->gd_selector; /* XXX */ + /* + * We reuse uefi selector for the code segment for the exception + * handler code, while the reason for the fault might be the + * corruption of that gdt entry. On the other hand, allocating + * our own descriptor might be not much better, if gdt is corrupted. + */ + loader_idt_e->gd_selector = fw_idt_e->gd_selector; loader_idt_e->gd_ist = 0; loader_idt_e->gd_type = SDT_SYSIGT; loader_idt_e->gd_dpl = 0;