From patchwork Wed Oct 2 16:58:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 175027 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1020967ill; Wed, 2 Oct 2019 10:04:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaq/pzjHD8mxJN6I6Ip3l6lwLet7/xnc8tCwdFAXNKIog60/6PIcVZEAZ2FKjdgqYNLAsC X-Received: by 2002:a17:906:3495:: with SMTP id g21mr4074835ejb.100.1570035865947; Wed, 02 Oct 2019 10:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570035865; cv=none; d=google.com; s=arc-20160816; b=MOW6tLiKhjDIEVlk5JfCjdtRfX+BVobSYLzr1tnoKXkUMNe3yFxHY5/79kxkw0aOcC 5jSXxFL98CckC+5tjgeBCBseGqrMfaYzSWGKzzq8PJH5I9KB/d7PfyNLEoGmLkSBad4n fqmNJj94abuhm8NxTLP/+mC1KngX87OE7Iof0T/hBp4kVGHqi+NV6tt1C9hg3PMOh5To 671Z4oge3sJJoRFiEkfsvJbx5Qz+PDga4j1HO8XQUeS1lt8qqYwHyrNYMssIo1glgK+/ pO2NPohd12fl9FkPWHpQIrX4zx/ui9IlLsmnfqj9uWFUk6BO8rtwyZav4ta9KMdlXYpv uEag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4PokOnzm+oPBOfuUNXGxhTnYV86Xe9IUth6ohOE2Moc=; b=s/DylVVvzxhacsixmtZAhM7nM81Hrq2YLsX/1bCjXZshqsw8CIESZDe3eDcKCJHrHJ yBVY1yO+MxnPvoGr4xYRz80OEiCbXZSHp4JO7ghmXe7pje4PWJXgbi04BHQHVlnqhWsh o3OD5mNE7PvIt5KZnEtTItVQz8Arw+8aHcI7z5z6OhG4j1pplRDtaoLic4kHXLqKL9rK f/vzecVHYGpBD2oBm7Cn+R8qieIYqPQAeHKbQZCmXqFHIesAyqKb/4ZrRLuSV99v4xHS +gHNpso2U1+1g337Txsj5FH+r8vBtTyde2R5oq+hIESkGDUk0v+sUDJ2Lo6ahngPKXUB on6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lbaRKl9S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (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 f30si12200293ede.435.2019.10.02.10.04.25; Wed, 02 Oct 2019 10:04:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lbaRKl9S; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728624AbfJBRDy (ORCPT + 27 others); Wed, 2 Oct 2019 13:03:54 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:38453 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728049AbfJBRDw (ORCPT ); Wed, 2 Oct 2019 13:03:52 -0400 Received: by mail-wr1-f68.google.com with SMTP id w12so20534363wro.5 for ; Wed, 02 Oct 2019 10:03:51 -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 :mime-version:content-transfer-encoding; bh=4PokOnzm+oPBOfuUNXGxhTnYV86Xe9IUth6ohOE2Moc=; b=lbaRKl9Sw32KcoJuKhy42btRwwnIf5qJkXgklbtMtdTbbKv9pfLbW8DQBaa9xY5ueH mmbRwytKylLFYjmSQZTewjfV8VsUpRx3BTL+xqyuRXVafUDmdiCQwyN3rSl8WcqN95Iz kEt0DMUYERZOm/UNlapCkAufqsyg+s2LwOVIiBtgDyHRALMfem6bQFzj6rvW6bTNTQrK chCtI4XLB6lJZAuPsb8nnelrEJPjBDa4btRcSPvvNoI6U7StdRMeAEiqS9g0cTY+LkUb vRoX7QmBpMW4QJw0JDclENNx4D1okrRBxnYuJyl2qTuwqd9bB+ET/kBayqgR2YuoLRPM AdIg== 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=4PokOnzm+oPBOfuUNXGxhTnYV86Xe9IUth6ohOE2Moc=; b=gVJzrEL+kWp4DddaAmzzdynevlHLRmFkhccysCLlmJLUMnqAMUk4f6riiig8qENv1a vU4RP9YhkrLxlvuNn4QVHO8FOxToyDEEOWO0KGrxx70xYTP5SUs7J99RUKRWahWUGh8R 2DW1yO687BV0lBZW6cF80sBNKiE7LvraJETl6aTvf491FKLcn+JHFt37TlGKBKeZ9A3/ 1VfyFwT2Au6gfrAXB0BLsw5HYrMvhYs0zerA62dloNKduw3EXuHUFco0r3YU7hC54eoF fF7oD8odbrzNS8KUM5FgV74v5nf9QjgmBafOvHsyoj70sf7CHD3CwKToAbi03CH/U4zY Vb9g== X-Gm-Message-State: APjAAAXJ1sxEhZtNNQnoznfZXWD1/wE3yDjQrglKgTYx8IFRBuAMITke 9d+AYtjegDbGGVvaCXr3Q53+ng== X-Received: by 2002:adf:ea88:: with SMTP id s8mr3787044wrm.114.1570035830342; Wed, 02 Oct 2019 10:03:50 -0700 (PDT) Received: from sudo.home ([2a01:cb1d:112:6f00:f145:3252:fc29:76c9]) by smtp.gmail.com with ESMTPSA id f18sm7085459wmh.43.2019.10.02.10.03.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 10:03:49 -0700 (PDT) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, Ingo Molnar , Thomas Gleixner Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, Ben Dooks , Dave Young , Jarkko Sakkinen , Jerry Snitselaar , linux-integrity@vger.kernel.org, Lukas Wunner , Lyude Paul , Matthew Garrett , Octavian Purdila , Peter Jones , Scott Talbert Subject: [PATCH 1/7] efi: cper: Fix endianness of PCIe class code Date: Wed, 2 Oct 2019 18:58:58 +0200 Message-Id: <20191002165904.8819-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191002165904.8819-1-ard.biesheuvel@linaro.org> References: <20191002165904.8819-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lukas Wunner The CPER parser assumes that the class code is big endian, but at least on this edk2-derived Intel Purley platform it's little endian: efi: EFI v2.50 by EDK II BIOS ID:PLYDCRB1.86B.0119.R05.1701181843 DMI: Intel Corporation PURLEY/PURLEY, BIOS PLYDCRB1.86B.0119.R05.1701181843 01/18/2017 {1}[Hardware Error]: device_id: 0000:5d:00.0 {1}[Hardware Error]: slot: 0 {1}[Hardware Error]: secondary_bus: 0x5e {1}[Hardware Error]: vendor_id: 0x8086, device_id: 0x2030 {1}[Hardware Error]: class_code: 000406 ^^^^^^ (should be 060400) Signed-off-by: Lukas Wunner Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/cper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index addf0749dd8b..b1af0de2e100 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -381,7 +381,7 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, printk("%s""vendor_id: 0x%04x, device_id: 0x%04x\n", pfx, pcie->device_id.vendor_id, pcie->device_id.device_id); p = pcie->device_id.class_code; - printk("%s""class_code: %02x%02x%02x\n", pfx, p[0], p[1], p[2]); + printk("%s""class_code: %02x%02x%02x\n", pfx, p[2], p[1], p[0]); } if (pcie->validation_bits & CPER_PCIE_VALID_SERIAL_NUMBER) printk("%s""serial number: 0x%04x, 0x%04x\n", pfx,