From patchwork Fri May 4 05:59:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 134941 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp436815lji; Thu, 3 May 2018 23:01:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqP+vDqWVG4qK1WDP5RKWkJTTSLn7U4tQh9JKoCozORDMyUtwFdWaxdX79Ye0CIj5R2O4dD X-Received: by 2002:a63:69c3:: with SMTP id e186-v6mr21290988pgc.353.1525413675399; Thu, 03 May 2018 23:01:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525413675; cv=none; d=google.com; s=arc-20160816; b=GcQ97p0wZnVg+XisIaU6MWvYR/5h8QUo3llgBFai3Yc16BAK82Io+7gK0Kt92SCjex 5IKIYAz0Zs5r+6Jq0MSvirRn3qDUFSG3kbrmBBkb/+n/4C4hgt93Yihjzdr6DGgZBGCW 8yHTP8wjBXrOCpE5NPFBWiuaI9Da02m9KTK+Qfw7q/PE1xYOXkdgEDJixUSkWTJOTo+t RPXvetguRdutSLthXNjMCaPAhxBxJeeiaCQKKgOHm+P+klaHZv3phm4A+TkJMRX6p1Tg 9M3ZFWTbbUJ7iaKHPHnqm95z4w0vHdnOOkH5YayndUWLIzAa3SK2xMUGajWqQ+lLqRDV pOkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=xPnWiymo7jyjUO31pkHyhT1jxuRfcYXb6BfF3fzVUCs=; b=zMY2bJcKOd8mqTGmtV/lV6hEKoZEzrbPpbXu1nXuHKsT9a5ld4flVOh23LnNxf3kx9 aJZKgchmzzq/1ynWuLRno++SLk6G2hLB3+YxggETuSkjkZTyslAw7rH4vrOlD9R6Z3cn FBduahwaonBy3yBBLbtPUIPenUttdrJJmInps6lDEhZzn1U5Akk09S2ACgPp96FTCvdt g4M1hL0jBDDk3IRBF4TuZDXtx+yBmggUiPw0Tog21K42JYxhbybvVAf23C4fZaOUldQe FsRWt23af8rdDGIk1m+lBdJdJ8TFooKb3Pi6OQRvfjQO9Ol8IKo0oxwegAy24ELBMiYe 94IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EF93XU8e; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b11-v6si5404750pgt.629.2018.05.03.23.01.15; Thu, 03 May 2018 23:01:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=EF93XU8e; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751522AbeEDGBO (ORCPT + 2 others); Fri, 4 May 2018 02:01:14 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:41391 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751484AbeEDGBM (ORCPT ); Fri, 4 May 2018 02:01:12 -0400 Received: by mail-wr0-f195.google.com with SMTP id g21-v6so19755289wrb.8 for ; Thu, 03 May 2018 23:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=04YzESrWSqCb1wPHUOkcSLeeXaR7ExOS522dozm70w4=; b=EF93XU8eUb51+9Yswic7ejYtTPCiU0PHEwYi2HybtjVABrOaN7LW0ReG8bKlinkQP9 UfYFHYIcW9Xs84YBg2xW0WLyGzJJWtVkUPIlvBbnjU4y/lhDQpshRrz15DkHAmR6W4Cm CuAyQIVivp6l4tYs2rhRD6ZO3jXueyn4eJVNA= 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; bh=04YzESrWSqCb1wPHUOkcSLeeXaR7ExOS522dozm70w4=; b=gUuVOFwA6gD9tU1PMF5Kk7066OIvmapFG6jXvp9I4b0XnFoINVIbTvdgaKW3/FS7IV CMKU/6pcyc+zvR8DdhVLvuOIeIQ0PzLrU8r+XjJpAtSi/+XFV6qTxviDAA/AMcVDD+uR r/Bm0Kc2Hp+/hralU8p9JhMgoPNvNw2x4bHC7L9vSC3sNEkI46C5sprFlRBZB/q0w8t+ J6F22trp63sMUTS0LZ8pYHYOhH/OILAcexa7S8zssXmnfwLZSJUDvuzyiLUUNbQFNPM6 cb792utXr9PlnsD9NfqzQQXgTbUZXASKu4to7T+80VS7GxXhXlJZ3SkMaXuLy19A2ARr FJdg== X-Gm-Message-State: ALQs6tBsdXTLPa2hMVR01Z1eoYpqWHLMmw9PImhUY/QKKWCTXBCBLLXH hkHQRnUgK6Ps3yaHerZZjm/NhKlFQYI= X-Received: by 2002:adf:a805:: with SMTP id l5-v6mr18701029wrc.97.1525413671030; Thu, 03 May 2018 23:01:11 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:3995:5470:200:1aff:fe1b:b328]) by smtp.gmail.com with ESMTPSA id i30-v6sm32411863wra.38.2018.05.03.23.01.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 May 2018 23:01:10 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Yazen Ghannam , Ard Biesheuvel , linux-kernel@vger.kernel.org Subject: [PATCH 05/17] efi: Decode IA32/X64 Processor Error Info Structure Date: Fri, 4 May 2018 07:59:51 +0200 Message-Id: <20180504060003.19618-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180504060003.19618-1-ard.biesheuvel@linaro.org> References: <20180504060003.19618-1-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org From: Yazen Ghannam Print the fields in the IA32/X64 Processor Error Info Structure. Based on UEFI 2.7 Table 253. IA32/X64 Processor Error Information Structure. Signed-off-by: Yazen Ghannam Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/cper-x86.c | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) -- 2.17.0 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/firmware/efi/cper-x86.c b/drivers/firmware/efi/cper-x86.c index 863f0cd2a0ff..e0633a103fcf 100644 --- a/drivers/firmware/efi/cper-x86.c +++ b/drivers/firmware/efi/cper-x86.c @@ -9,9 +9,20 @@ */ #define VALID_LAPIC_ID BIT_ULL(0) #define VALID_CPUID_INFO BIT_ULL(1) +#define VALID_PROC_ERR_INFO_NUM(bits) (((bits) & GENMASK_ULL(7, 2)) >> 2) + +#define INFO_VALID_CHECK_INFO BIT_ULL(0) +#define INFO_VALID_TARGET_ID BIT_ULL(1) +#define INFO_VALID_REQUESTOR_ID BIT_ULL(2) +#define INFO_VALID_RESPONDER_ID BIT_ULL(3) +#define INFO_VALID_IP BIT_ULL(4) void cper_print_proc_ia(const char *pfx, const struct cper_sec_proc_ia *proc) { + int i; + struct cper_ia_err_info *err_info; + char newpfx[64]; + if (proc->validation_bits & VALID_LAPIC_ID) printk("%sLocal APIC_ID: 0x%llx\n", pfx, proc->lapic_id); @@ -20,4 +31,41 @@ void cper_print_proc_ia(const char *pfx, const struct cper_sec_proc_ia *proc) print_hex_dump(pfx, "", DUMP_PREFIX_OFFSET, 16, 4, proc->cpuid, sizeof(proc->cpuid), 0); } + + snprintf(newpfx, sizeof(newpfx), "%s ", pfx); + + err_info = (struct cper_ia_err_info *)(proc + 1); + for (i = 0; i < VALID_PROC_ERR_INFO_NUM(proc->validation_bits); i++) { + printk("%sError Information Structure %d:\n", pfx, i); + + printk("%sError Structure Type: %pUl\n", newpfx, + &err_info->err_type); + + if (err_info->validation_bits & INFO_VALID_CHECK_INFO) { + printk("%sCheck Information: 0x%016llx\n", newpfx, + err_info->check_info); + } + + if (err_info->validation_bits & INFO_VALID_TARGET_ID) { + printk("%sTarget Identifier: 0x%016llx\n", + newpfx, err_info->target_id); + } + + if (err_info->validation_bits & INFO_VALID_REQUESTOR_ID) { + printk("%sRequestor Identifier: 0x%016llx\n", + newpfx, err_info->requestor_id); + } + + if (err_info->validation_bits & INFO_VALID_RESPONDER_ID) { + printk("%sResponder Identifier: 0x%016llx\n", + newpfx, err_info->responder_id); + } + + if (err_info->validation_bits & INFO_VALID_IP) { + printk("%sInstruction Pointer: 0x%016llx\n", + newpfx, err_info->ip); + } + + err_info++; + } }