From patchwork Thu Feb 21 06:28:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045778 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l216PGpz9sBF for ; Thu, 21 Feb 2019 17:29:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="tyaj02KL"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="z6Ag56qO"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l2152rDzDqNP for ; Thu, 21 Feb 2019 17:29:45 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="tyaj02KL"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="z6Ag56qO"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1M3lmczDqN6 for ; Thu, 21 Feb 2019 17:29:11 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 12C0821F79; Thu, 21 Feb 2019 01:29:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=VQ3RS6X24Mtkb J18opwA7FdCisCR/CC8HqVoe+Mo6Go=; b=tyaj02KLngEVxdkjijqUS1G4QTeOd JfdA2kFWUaQiifsQ3odL4v634vrwJL5JskpUCbyDYLq5+nE/E4gIlf37s1S7SWD9 +kpn6dwYWH7q2yOBZpLc8ezWfBMJe0Qt0cOEA2w1exM7Aq5mE2Bo+PmA033aBdic amOlu/x8YP3nMrTCHAimY3mXlCP+5NXCJL7XTDoc2EqkpeVm9soZQPAsl/0kjpw0 OiwEzoHeVFrZKLLYCW3FfK8TCx3xptAb7ppr3IRcScHsx+rgerirgKjVhZDGurCk f4wjFBgxHGDNARu0Tom3hzGupMXx1Gx9uJ+VfUAATChY/N/8TO2CKQC1w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=VQ3RS6X24MtkbJ18opwA7FdCisCR/CC8HqVoe+Mo6Go=; b=z6Ag56qO APYEz7jrZJfx1LCLFDMhHIJuS8MfHT9Z7rXK8wFxrOSQD+SYkzGAKzAKifreGQwE h3sIe0uXk1+oWgAKMW/DwqwwMDtPHXtpp+3EL/kdopWOlIUwd9mX0sQN4V7EQIMK tfPG3ZxgbPD8jpdVRvg29NuzM9suLm9vIKT+zUAC+ZOsxJruwt66QGPndUkcq8g0 KMsXzR7dA/9ziTwX0GP04VurZG4A6kCdjfYpHWrq7v3xh+KdenLAJ3KH7ML0TGoT tosN36DsoIMfYtTEX39h7Fotm+xfyqCFC29MR4KBq3ZZe7ZlAwEbqA4J7JUDU4SM Rl9RDs2zsuZT9A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdelieculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedt X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 3D23CE4210; Thu, 21 Feb 2019 01:29:06 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:00 +1030 Message-Id: <20190221062851.21958-2-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 01/52] libflash/test: Generate header dependencies for tests X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/Makefile.check | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libflash/test/Makefile.check b/libflash/test/Makefile.check index f5ed1ee7c3dd..1e55237193f0 100644 --- a/libflash/test/Makefile.check +++ b/libflash/test/Makefile.check @@ -30,7 +30,7 @@ check_PROGRAMS = \ libflash/test/test-ecc \ libflash/test/test-mbox -TEST_FLAGS = -D__TEST__ +TEST_FLAGS = -D__TEST__ -MMD -MP .PHONY: libflash-check libflash-coverage libflash-check: $(check_PROGRAMS:%=%-check) $(CORE_TEST:%=%-gcov-run) @@ -162,3 +162,6 @@ libflash-test-gcov-clean: $(RM) $(GCOV_OBJ_STEMS:%=%.d) $(RM) $(GCOV_OBJ_STEMS:%=%.gcda) $(RM) $(GCOV_OBJ_STEMS:%=%.gcno) + +-include $(patsubst %,%.d,$(call objstem,$(check_PROGRAMS),$(HOST_TRIPLE)/)) +-include $(patsubst %,%.d,$(call objstem,$(check_PROGRAMS),$(HOST_TRIPLE)/gcov/)) From patchwork Thu Feb 21 06:28:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045779 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l2X2D14z9sBF for ; Thu, 21 Feb 2019 17:30:12 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="g99WOZXO"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="NUuGu2Z1"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l2X0t1pzDqN6 for ; Thu, 21 Feb 2019 17:30:12 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="g99WOZXO"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="NUuGu2Z1"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1Q3H86zDqN8 for ; Thu, 21 Feb 2019 17:29:14 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 138BF22167; Thu, 21 Feb 2019 01:29:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm2; bh= N04OJY6AvmyFcyihP92bjaLq+68e8rOJ0BwEBYvxK/k=; b=g99WOZXOMiGjbSFa kL7PJDX2ZFKfIpFJV1MKidwVmZZnUSxNU3Oap7/GBURYrtV01JsPm3zDmhbmxOCl czJEpnUHsO57nUNVK86n6/vhLxZpaWHnlMdB5OHvJnkOGpU7Ij9vktz98Oj8tVS6 yIYj7l77xpPFjl0ORSzmBr6q8WgmWWZraiBNg0HmLIHr4DAwFvyXTJVhKrkRUDTz EBmi2erA8pM/YkuzIogEQfGzikq717Sx70eZH9nM9HF+mxiL9MHzzgTiJpTxghL9 S8nTI1GsSZW7riSumFv3T/yYOAWMY3R6vUu5DVjrjTFtvgqgpYhuj6vdsMhaRw63 kkdPYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=N04OJY6AvmyFcyihP92bjaLq+68e8rOJ0BwEBYvxK /k=; b=NUuGu2Z1lrU02FDdna166tg/kwIYNuo1FSyo8rIys/u3SLDZpWaDgBg8D UPPp4J2GFY6mJ5/JAJI8KrC8eQlwR1Aeixh0IBaEkrzrXDxpRGJ9sLFyU8IQ+Np5 cJ9czVDFDbYPDCBzS2LXf2hI3CbsmY1s8ZI9yt3gCI+PMQeJkbVtYUlWMsJareyv Pd9Kz9v4Dh9+vn0NISt9sj8SOfdcAkuWCzAXNxE1pD5ReH86bCF5CypYA09H7utw 7A2NfcHhNRZl7Vw8hEzDVMdt03UG+JT8DugdAbc69hRtYvT6cgKl27LrvRD/xoIy DZgtawGpTiA0jLV0UYhcYZAibyCYQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhggtgfgsehtke ertdertdejnecuhfhrohhmpeetnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfies rghjrdhiugdrrghuqeenucfkphepvddtvddrkedurddukedrvdeknecurfgrrhgrmhepmh grihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghunecuvehluhhsthgvrhfuihii vgeptd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 52F44E4210; Thu, 21 Feb 2019 01:29:09 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:01 +1030 Message-Id: <20190221062851.21958-3-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 02/52] ffspart, libflash: Fix stack size warnings X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" libflash/file.c: In function 'file_erase': libflash/file.c:134:1: error: the frame size of 4128 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] } ^ and ffspart.c: In function ‘main’: ffspart.c:529:1: error: the frame size of 4864 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] } ^ In both cases, mark the local variables as static to avoid the stack. The static approach is valid for file.c as the buffer is always filled with `~0`. Given it's now going to be in .bss due to static we have to still perform the memset(), but racing memset()s in this fashion won't be harmful, just wasteful. For ffspart.c's main(), there are bigger problems if that needs to be re-entrant. Signed-off-by: Andrew Jeffery --- external/ffspart/ffspart.c | 4 +++- libflash/file.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/external/ffspart/ffspart.c b/external/ffspart/ffspart.c index bb46a9eaf311..9fc015cf872b 100644 --- a/external/ffspart/ffspart.c +++ b/external/ffspart/ffspart.c @@ -350,7 +350,9 @@ static void print_help(const char *pname) int main(int argc, char *argv[]) { - char *pnor = NULL, *input = NULL, line[MAX_LINE]; + static char line[MAX_LINE]; + + char *pnor = NULL, *input = NULL; bool toc_created = false, bad_input = false, allow_empty = false; uint32_t block_size = 0, block_count = 0; struct ffs_hdr *tocs[MAX_TOCS] = { 0 }; diff --git a/libflash/file.c b/libflash/file.c index 72765b5777f9..d790e29df103 100644 --- a/libflash/file.c +++ b/libflash/file.c @@ -117,7 +117,7 @@ static int file_write(struct blocklevel_device *bl, uint64_t dst, const void *sr */ static int file_erase(struct blocklevel_device *bl, uint64_t dst, uint64_t len) { - char buf[4096]; + static char buf[4096]; int i = 0; int rc; From patchwork Thu Feb 21 06:28:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045780 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l343F4Gz9sBF for ; Thu, 21 Feb 2019 17:30:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="FgsWnkjA"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="8XJY4IFa"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l342H8GzDqNJ for ; Thu, 21 Feb 2019 17:30:40 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="FgsWnkjA"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="8XJY4IFa"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1R61XjzDqMH for ; Thu, 21 Feb 2019 17:29:15 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3EECF21E5A; Thu, 21 Feb 2019 01:29:13 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=pYsqL/oxiRZFK TP7X+MN69greVviOEEVeEW4S78OloM=; b=FgsWnkjAdHoMehxT0arRpWO+VO1v6 Sss99Xkdn44kAuQ9ffvWdutPTDIbtiSoWbplx1AamnPeS+DCFTsDgrlbwuyIU5BP gPWzy8jZqYrwbvb5qtNT9PtgKVujX2XUySgDXR0ShPe8wlH3HdQoMM5DhOnmGjUw wUNVw5gfuNm1BMuFZUjZU5Oem+SYHUD312tfBUU2kGZ3wJco8o1iU2wsDCu3tcPi 9eOKVoAzf4crTZUvYMvRE3i81+hAZ9nqqlm+zFuvUDRyQmhcw+2Pt7VNCbdNJzHP IiJ1r6m3n7OCvAa5lZggoAE1/3J+9RC3WVsXVsOGBigG9Z+PnZ8gwVshA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=pYsqL/oxiRZFKTP7X+MN69greVviOEEVeEW4S78OloM=; b=8XJY4IFa 5heKWFnaU4149OVVbucQztn0s5ZK8w3JsKYsQjlT5SLp7STWGZa9Zw8s49pPBXeb 9Q1+LE7RuDRJrgaJzK6m4awL23yLxAR1nHZApH8RPKeRRTg/FlcTibHuMrnKhx0p qNZ+/ODVf+8pMyDWPR5L81Xqypkyrc+BL7ujCIKC8kp8mIYfI01maSa1qFoVLF3B TC9NLQnFTSAOoF/5AfzE+gfc2VjsxihlK3Gn0HvLR9tZHyx+sfCqir3wtZXE8Vl8 QOTW4y/JSUCWxtjb9J89TEsopTTYNdz2r/mqqeVZFSGUKdkynCXogXCgfQwXdCNT +l/tvi1q/QKvIQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedt X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 450EEE419A; Thu, 21 Feb 2019 01:29:11 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:02 +1030 Message-Id: <20190221062851.21958-4-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 03/52] pflash: Increase stack frame size warning threshold X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" pflash is a userspace tool, stack space isn't really a constraint that we care about. Signed-off-by: Andrew Jeffery --- external/pflash/rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/external/pflash/rules.mk b/external/pflash/rules.mk index 5839fec64aad..ffc32424167e 100644 --- a/external/pflash/rules.mk +++ b/external/pflash/rules.mk @@ -50,6 +50,7 @@ $(LIBFLASH_OBJS): libflash-%.o : libflash/%.c | links $(CCAN_OBJS): ccan-list-%.o: ccan/list/%.c | links $(Q_CC)$(CC) $(CFLAGS) -c $< -o $@ +$(EXE): CFLAGS += -Wframe-larger-than=2048 $(EXE): $(OBJS) $(Q_CC)$(CC) $(LDFLAGS) $(CFLAGS) $^ -lrt -o $@ From patchwork Thu Feb 21 06:28:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045781 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l3k621Sz9s8m for ; Thu, 21 Feb 2019 17:31:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="C8GwfZvk"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="eFCdEKTz"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l3k4xfQzDqN8 for ; Thu, 21 Feb 2019 17:31:14 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="C8GwfZvk"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="eFCdEKTz"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1T3X7hzDqMH for ; Thu, 21 Feb 2019 17:29:17 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 437E6221E7; Thu, 21 Feb 2019 01:29:15 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm2; bh= kJRzA6GQl5sUNJX55GCvImDG+yF7sC9qmrmreS1nXU0=; b=C8GwfZvk4XYmGBEz cqpIy68xljNb3akDNo+sG3wnYif7PVBfEm+5qIeA+BHMAOjiPAXz2kNrabJE6Bkw fo0JIJtBp5h5X/ipgqUnL+T4iyASde+d1pqAt9SSK2PvgJaZnExxyNGiqaa88x9g kWeU0TzH+Bh4yvY7FSWzoMM24Xy406/9N+x1m4L8Rkyxb524Pdwo8dVYPVJm9T3A 3ws+qf0wpPcHsur8kItUbh0QQoK7dk7xuqpEVZVFYAnZG4y1FNWsa7gPw/g9wqpo Zu5chylXovFBxpxcbwPknc6R+tNz13zCJcFuz29ul1TfPMlii/61AVeEe1e+pnRp 0OYP7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=kJRzA6GQl5sUNJX55GCvImDG+yF7sC9qmrmreS1nX U0=; b=eFCdEKTz05TD94L2XBrrtqdx22w1XIno9EIAoe5/mWSURgIh4Mx5SNgnU Kk3hCY6mYIh5RwIA8fW7aJ4equknx/m2MfjVNuSSh1zhdVH2OoaNn3ohfOtymtpm prcY2rwYTWZxq+CvW4lBFwIFzf7H/AvqHfRprFJ7Pf1SSnnZ5YZwHUnelzbM4QXo 8TDOOB+RTFvQEBjD5WfNgdzKp8wCvZ3caHsSucBbeOf/ImP6M3yglYUTjZr7qtoj C6ZeF+1StYEUFEqUOjmVO8MYII28H6aEYFYTuWJC8+sJodE1d0FshPIrfuDlzfEH Z9TwVoqqClIgtDSVdJPlH4xYn5kQg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhggtgfgsehtke ertdertdejnecuhfhrohhmpeetnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfies rghjrdhiugdrrghuqeenucfkphepvddtvddrkedurddukedrvdeknecurfgrrhgrmhepmh grihhlfhhrohhmpegrnhgurhgvfiesrghjrdhiugdrrghunecuvehluhhsthgvrhfuihii vgeptd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 72224E419A; Thu, 21 Feb 2019 01:29:13 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:03 +1030 Message-Id: <20190221062851.21958-5-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 04/52] gard: Fix warnings from gcc 8.2.0 X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" gard.c:285:5: error: no previous prototype for ‘parse_path’ [-Werror=missing-prototypes] int parse_path(const char *str, struct entity_path *parsed) ^~~~~~~~~~ gard.c: In function ‘do_list’: gard.c:459:46: error: unused parameter ‘argc’ [-Werror=unused-parameter] static int do_list(struct gard_ctx *ctx, int argc, char **argv) ~~~~^~~~ gard.c:459:59: error: unused parameter ‘argv’ [-Werror=unused-parameter] static int do_list(struct gard_ctx *ctx, int argc, char **argv) ~~~~~~~^~~~ Signed-off-by: Andrew Jeffery --- external/gard/gard.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/external/gard/gard.c b/external/gard/gard.c index c686791e858c..16da76a3149a 100644 --- a/external/gard/gard.c +++ b/external/gard/gard.c @@ -282,7 +282,7 @@ static char *format_path(struct entity_path *path, char *buffer) * path_element[2] = {2, 1} * } */ -int parse_path(const char *str, struct entity_path *parsed) +static int parse_path(const char *str, struct entity_path *parsed) { int unit_count = 0; @@ -456,7 +456,8 @@ static void draw_ruler(char c, int size) putchar('\n'); } -static int do_list(struct gard_ctx *ctx, int argc, char **argv) +static int do_list(struct gard_ctx *ctx, int argc __attribute__((unused)), + char **argv __attribute__((unused))) { /* This header matches the line formatting above in do_list_i() */ const char *header = " ID | Error | Type | Path"; From patchwork Thu Feb 21 06:28:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045782 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l4D5dlLz9s6w for ; Thu, 21 Feb 2019 17:31:40 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="P2Xp8Tf+"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="GovIlzTz"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l4D4XLDzDqNJ for ; Thu, 21 Feb 2019 17:31:40 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="P2Xp8Tf+"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="GovIlzTz"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1W5VGmzDqMH for ; Thu, 21 Feb 2019 17:29:19 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5AD5B21E5A; Thu, 21 Feb 2019 01:29:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=QZQXk4fWjO+JN rwHeyBnjDdDnD5feye61A3qcrBbcFI=; b=P2Xp8Tf+vHqdPwCrHqATXBsw8ISLP 6emLz9QGKBXJWEoQnEwMiQzpl4o+sgY9qXKnY/i40vTOsruKXsps652FYwgAtLLj cKx62I0FffW4Xig4P7W9xLtHaTfCdYM8PNrtPZeJiMjvHaknTiIHbAaYW4FdyI9J RfNJU3Q9c3In/U5KHVRFsPU0og9XS85v+GzrMf7tL2euwGMb2w79vbFKU1pHPVWM xm56tg87qv41c9MBFKrmgzu04851gpfIC90PW7VjrJtwrJ2+Da92XghvdvdAwlXq nFOXdzb+/f9Dl9AxbrzAQvCIUu9LW4NRlPWHD4psTso3avneeZuBDK8HQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=QZQXk4fWjO+JNrwHeyBnjDdDnD5feye61A3qcrBbcFI=; b=GovIlzTz xjH6mqZJXlrZ57+/t4QOfUGAWGt/PR8myJqvEPhuF6RLU24ZmqaM5HfAr530unXg tuQ4GhIXkeUCYxY6VbceWHwLC3rzQxZVHOfhcT1tLnr85symaBl+G+Hqz+mnYaFM 9+du5dUKhY8efIWNOebzcwkP9cGt1e+VNtbIldxg7NqSnIcnqW4YhKAIES3RupYT yTdqBPkOnRG9UFK3O7C0eeuU8ISfxTVmIlL1qd7t7OhDnI18UfKmb+Ea6KA3Shso 1oYdD8+wUJytR+hHSv2SlkCJkh36VwKNSsYA7K9pG35n2JWaIFRkuCASTLcpMLVJ 80wGd7+VdXo4Hg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedu X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 6767BE419A; Thu, 21 Feb 2019 01:29:15 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:04 +1030 Message-Id: <20190221062851.21958-6-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 05/52] Makefile: Paper over gard and pflash coverage issues X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" `make coverage-report` gave the following error: (cd external/pflash; lcov -q -c -d . -o pflash.info --rc lcov_branch_coverage=1; sed -i -e 's%external/pflash/libflash%libflash%; s%external/pflash/ccan%ccan%' pflash.info) (cd external/gard; lcov -q -c -d . -o gard.info --rc lcov_branch_coverage=1; sed -i -e 's%external/gard/libflash%libflash%; s%external/gard/ccan%ccan%' gard.info) geninfo: WARNING: no .gcda files found in . - skipping! geninfo: WARNING: no .gcda files found in . - skipping! lcov -q -c -d . -d ccan/check_type/test/ -d ccan/str/test/ -d ccan/str/test/ -d ccan/list/test/ -d ccan/list/test/ -d ccan/list/test/ -d ccan/list/test/ -d ccan/list/test/ -d ccan/build_assert/test/ -d ccan/short_types/test/ -d ccan/short_types/test/ -d ccan/array_size/test/ -d ccan/container_of/test/ -d ccan/endian/test/ -d libc/test/ -d libc/test/ -d libc/test/ -d libc/test/ -o skiboot.info --rc lcov_branch_coverage=1 lcov -q -r skiboot.info 'external/pflash/*' -o skiboot.info lcov -q -r skiboot.info 'external/gard/*' -o skiboot.info lcov -q -a skiboot.info -a external/pflash/pflash.info -o skiboot.info lcov: ERROR: no valid records found in tracefile external/pflash/pflash.info make: *** [/home/andrew/src/open-power/skiboot/Makefile.main:315: skiboot.info] Error 255 And similar again for the gard tool. We should really untangle the build strategy for tools in external/, but in the mean time paper over the problem of generating the lcov output at the top level by ensuring we have a means to generate the necessary gcda files for lcov to consume. Signed-off-by: Andrew Jeffery --- Makefile.main | 8 ++++++++ external/gard/Makefile | 4 ++++ external/pflash/Makefile | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/Makefile.main b/Makefile.main index 15c906752f6d..096a58d56986 100644 --- a/Makefile.main +++ b/Makefile.main @@ -225,9 +225,17 @@ include $(SRC)/libstb/Makefile.inc gard: (cd external/gard; CROSS_COMPILE="" CFLAGS="$(HOSTCFLAGS) $(HOSTGCOVCFLAGS)" make) +coverage: gard-coverage +gard-coverage: + (cd external/gard; CROSS_COMPILE="" CFLAGS="$(HOSTCFLAGS) $(HOSTGCOVCFLAGS)" make coverage) + pflash: (cd external/pflash; CROSS_COMPILE="" CFLAGS="$(HOSTCFLAGS) $(HOSTGCOVCFLAGS)" make) +coverage: pflash-coverage +pflash-coverage: + (cd external/pflash; CROSS_COMPILE="" CFLAGS="$(HOSTCFLAGS) $(HOSTGCOVCFLAGS)" make coverage) + pflash-coverity: (cd external/pflash; ./build-all-arch.sh) diff --git a/external/gard/Makefile b/external/gard/Makefile index 2ccd1440df6b..50589cf482cd 100644 --- a/external/gard/Makefile +++ b/external/gard/Makefile @@ -5,6 +5,10 @@ include ../../external/common/rules.mk all: links arch_links $(EXE) +.PHONY: coverage +coverage: CFLAGS += -fprofile-arcs -ftest-coverage +coverage: check + #Rebuild version.o so that the the version always matches #what the test suite will get from ./make_version.sh check: version.o all diff --git a/external/pflash/Makefile b/external/pflash/Makefile index 5395bdfa533b..243de6ee0670 100644 --- a/external/pflash/Makefile +++ b/external/pflash/Makefile @@ -4,6 +4,10 @@ include ../../external/common/rules.mk all: links arch_links $(EXE) +.PHONY: coverage +coverage: CFLAGS += -fprofile-arcs -ftest-coverage +coverage: check + #Rebuild version.o so that the the version always matches #what the test suite will get from ./make_version.sh check: version.o all From patchwork Thu Feb 21 06:28:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045783 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l4f4l1cz9s6w for ; Thu, 21 Feb 2019 17:32:02 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="SZ42iK83"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Mh2Ke2qj"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l4f3gpTzDqNW for ; Thu, 21 Feb 2019 17:32:02 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="SZ42iK83"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Mh2Ke2qj"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1Y5GcTzDqND for ; Thu, 21 Feb 2019 17:29:21 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7E8BD22167; Thu, 21 Feb 2019 01:29:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=LQMX1yiQaLZLM oEBZY0ppxFlQWBsSQGq25v1WBPmcXo=; b=SZ42iK83/QyEj5Mp3L2rDej5/MqXN xKII1/KnwUQgzYU3s9TYpbPu+tKwsJWtJBiQxcPhaMQyXlMIzGyoOC/60/aP2FRs rczOfhdewADvZ0vQ98ysPpgYa/Dbr9t+TlnrVpEn6jlMIJ1Uf/NhIim1/d163TJO ZJdLWqtpwDNTWouaAii0WxsYi53UgYMlKcEbbKuIF8dAl7wjHR8Yga7DnE256X5B u/cyOKfhkRQo9+4ROCMhhd1G00lLhKeIIZNC5O9MXLxkHoqKHooKv9ewxK5lcPur D4P0XRfyeS+Tc8qzgXUFTPxmezPy4eDu+nXhy0GuAjMFVEvIeNnW0YB8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=LQMX1yiQaLZLMoEBZY0ppxFlQWBsSQGq25v1WBPmcXo=; b=Mh2Ke2qj hNqqzh+DbW3W6QD+ezTK13JlUigTqViL5PQhQJxaZVC3UPcWZNpBX/THTwePMIO5 l7g4OTLTH/qRe95QmSw2cr4rZGZgl8HDqT9Vf/cS/gCyg02k2Gg1iQele86evzV2 gDhrzt9gsoTC4AL4Po4kkPciXhQS1UaJkLAmqndqVe47v5SP+ngLg/3pQqvhvHoW Q4dZyMDv0NZkM4MLAwh6Ygsb07+KUuxemqY5SiiQ/ZZE6NpwljxmPqjB5NIzIwTO TILWs/4xbf9w4+/iFv6tBhYtxqMW/3Lqn6R/VylfReIq3Wwj4pBhYmnjwe6AGgIU dN6FZahiM7O4XA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedu X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 9054FE419A; Thu, 21 Feb 2019 01:29:17 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:05 +1030 Message-Id: <20190221062851.21958-7-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 06/52] test-ipmi-hiomap: Add ability to delay some IPMI messages X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The initial implementation delivered all BMC-initiated SELs immediately after the delivery of the last response to the host. In some circumstances we want slightly more control over how this works, so introduce a means to manually advance the scenario in the test case. Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 0ad08b4cf5bc..19e0cbf5c846 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -25,7 +25,8 @@ enum scenario_event_type { scenario_sentinel = 0, scenario_event_p, scenario_cmd, - scenario_sel + scenario_sel, + scenario_delay, }; struct scenario_cmd_data { @@ -79,6 +80,20 @@ static void scenario_enter(const struct scenario_event *scenario) ipmi_msg_ctx.cursor = scenario; } +static void scenario_advance(void) +{ + struct ipmi_msg_ctx *ctx = &ipmi_msg_ctx; + + assert(ctx->cursor->type == scenario_delay); + ctx->cursor++; + + /* Deliver all the undelayed, scheduled SELs */ + while (ctx->cursor->type == scenario_sel) { + ctx->sel.fn(ctx->cursor->s.bmc_state, ctx->sel.context); + ctx->cursor++; + } +} + static void scenario_exit(void) { assert(ipmi_msg_ctx.cursor->type == scenario_sentinel); @@ -393,6 +408,9 @@ scenario_hiomap_event_daemon_regained_flash_control_dirty[] = { }, }, }, + { + .type = scenario_delay + }, { .type = scenario_sel, .s = { @@ -460,6 +478,7 @@ static void test_hiomap_event_daemon_regained_flash_control_dirty(void) scenario_enter(scenario_hiomap_event_daemon_regained_flash_control_dirty); assert(!ipmi_hiomap_init(&bl)); assert(!bl->read(bl, 0, buf, len)); + scenario_advance(); assert(!bl->read(bl, 0, buf, len)); ipmi_hiomap_exit(bl); scenario_exit(); @@ -495,6 +514,9 @@ static const struct scenario_event scenario_hiomap_protocol_reset_recovery[] = { }, }, }, + { + .type = scenario_delay + }, { .type = scenario_sel, .s = { .bmc_state = HIOMAP_E_PROTOCOL_RESET, } @@ -598,6 +620,7 @@ static void test_hiomap_protocol_reset_recovery(void) scenario_enter(scenario_hiomap_protocol_reset_recovery); assert(!ipmi_hiomap_init(&bl)); assert(!bl->read(bl, 0, buf, len)); + scenario_advance(); assert(!bl->read(bl, 0, buf, len)); ipmi_hiomap_exit(bl); scenario_exit(); From patchwork Thu Feb 21 06:28:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045784 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l4y1bY3z9s6w for ; Thu, 21 Feb 2019 17:32:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="PEWghSum"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="DbW+N9Yv"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l4y05VczDqNP for ; Thu, 21 Feb 2019 17:32:18 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="PEWghSum"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="DbW+N9Yv"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1f5G5ZzDqNG for ; Thu, 21 Feb 2019 17:29:26 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7278F21F79; Thu, 21 Feb 2019 01:29:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=I5cyxulGhgv5v Lfu4y7ucWgClgmKJtbEOsasSmcUDcc=; b=PEWghSumh0Fo6eSfb3DkfL+5Vwvlf gofyChZZdK6wqz1KaJ/Wm/njbjipKWCOXNx3gkjaGSBP21yzj77pOaHtiJFUCOLZ oGxk/Z9k3/zPSN0aue8V/pHFT+yxhBKe+4ntO2UFDs4qIoHsXF5CNX3akKl6JhoW llJ1MgCvtj1e6oFkjdP37NkMdDo6B3iRGPrPMwt6qrbB25NMkbw+eQ91QpHViRfT 0dH59bIMmnADTtGdmnzNZQfKIody5ARO/iqgh7G+Sevm/TDNnZFDOOKuSU2KXKTo Ltn7otiL8y4jcYdDeUtv7dlQ4w0wJfECuRy8ONK8zVnLsJlV5EbqAAJvw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=I5cyxulGhgv5vLfu4y7ucWgClgmKJtbEOsasSmcUDcc=; b=DbW+N9Yv 1dx1qiyH7tuvDAS8P231B7eLZ9IbxD3LYMj5BJFIWa/J/XwrK//vL9NEi5UFuZoM pZ8XtNyo0Uy0v2Ko3Jsz0rcWc+V+ThZGcKz2gxEXwkj+Qi3ruxFD0g4dnC96NF3J Fdov0TFeTXGH8fAk1OqVgR2NXhoCCL9w59T0Oqyfec3t9YvfUndRYu4/d6CYggPD lzXhkg5rARibRiQvlrIM0nAkQkmbJCL9vt3M/aBpdMhhnDwhNSjwf2aXzfRXXLUT EvnTxaIDvCMYaenQ7q67sRyRiOVrmecLTEwsm6DR73Y/ptOFbzDno/7blGtgzbOY jW2fuGHAj7fyTw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peef X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id A340DE419A; Thu, 21 Feb 2019 01:29:19 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:06 +1030 Message-Id: <20190221062851.21958-8-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 07/52] test-ipmi-hiomap: Dump unexpected IPMI messages X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" These indicate an implementation bug or broken scenario. Either way it's helpful to know what arrived given it wasn't expected. Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 19e0cbf5c846..e2330fe85486 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -146,6 +146,9 @@ void ipmi_queue_msg_sync(struct ipmi_msg *msg) assert(ctx->cursor->p->type == scenario_cmd); cmd = &ctx->cursor->p->c; } else { + printf("Got unexpected request:\n"); + for (ssize_t i = 0; i < msg->req_size; i++) + printf("msg->data[%zd]: 0x%02x\n", i, msg->data[i]); assert(false); } From patchwork Thu Feb 21 06:28:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045785 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l5D5cdKz9s6w for ; Thu, 21 Feb 2019 17:32:32 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="eX6ALhZC"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="6NvEPFSi"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l5D4HVvzDqNn for ; Thu, 21 Feb 2019 17:32:32 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="eX6ALhZC"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="6NvEPFSi"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1m4S0MzDqMH for ; Thu, 21 Feb 2019 17:29:32 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3166D21F79; Thu, 21 Feb 2019 01:29:30 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=RNMBDd4z7tmFW IkcWlZ4TSnWgyypLRtvmNy07/uQqqE=; b=eX6ALhZCaYtCHcw18v1aaeB7d236j +mBqzAsvpKb06wvXDDqghy5uVcvG1UWh2e5hNcQyDwGnylv9IfVHQQ4ZHMLmmuQI id2wZr4GTezPNEXhBLIJm3OKGTceX9To4PtEWKDcyUVKnXWQV9auFkeK7x4KHFqA rT1mQSfp9D7F8dI9PnHCTMKIux7bn4HilZIGcGZt/GEcqKy5njxYxVoon7jDtGLt piKb64UvjnuO+bJJ5RyfvooRpszX77st2e1tDQdVXHdqRw2ddoo1u6WKuNeoFaBK eFiIYXPaGN6Rdcrv9OeouiYiU5lxH1byH6+jGT0SrAXZQU87TJK7NbEaQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=RNMBDd4z7tmFWIkcWlZ4TSnWgyypLRtvmNy07/uQqqE=; b=6NvEPFSi vKPD++IDOYCUadqAsALIQU9kwU+2fvozgdE+wxIfglL6SKYMlBZL1bi3dvSqFNwJ bUHm265uSfkRrpe8bNrWmjMYxx/9rGs7k5ipOprewNycV8pJG11yivixoMpCnncJ gwVxSNCiuFvn9f/0vl6NH+husorexJ1RdHUm8w5IUCViz5Nm8/ya/tlIHVtJr6Kk 6/Awq9KbnT1EB5z14H25IVckkL6d3uSRMZ8/oCjRZQC78UqVGeJMyV70JtjjYxaV 46akj1JxZNpGdUpLl7Z+9+XzwxqKrWy6+qA/A6Jge+fJ/NxJEFQHRr2FCmUQ0BHO HLL2CtKB8EYrRg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peeg X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 5F328E4210; Thu, 21 Feb 2019 01:29:27 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:07 +1030 Message-Id: <20190221062851.21958-9-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 08/52] test-ipmi-hiomap: Ensure the completion code is set X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" ipmi_queue_msg_sync() intercepts and implements the IPMI transfers for the test scenarios. In some scenarios we want to return IPMI error codes, so make sure the msg->cc field is set. Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index e2330fe85486..738352cc89f1 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -164,6 +164,8 @@ void ipmi_queue_msg_sync(struct ipmi_msg *msg) } assert(false); } + + msg->cc = cmd->cc; memcpy(msg->data, &cmd->resp, msg->resp_size); msg->complete(msg); From patchwork Thu Feb 21 06:28:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045786 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l5T3190z9s8m for ; Thu, 21 Feb 2019 17:32:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="jfw3vXFj"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="IVZ7K43X"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l5T2158zDqNn for ; Thu, 21 Feb 2019 17:32:45 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="jfw3vXFj"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="IVZ7K43X"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1p5QtRzDqNQ for ; Thu, 21 Feb 2019 17:29:34 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3F4CB2218B; Thu, 21 Feb 2019 01:29:32 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=JH/NDgHoQYhro lyZz9pQwD+Vgz7iCaEqmIN4USPEuEw=; b=jfw3vXFjWg6/+mtIkVyJRoiGkwacf Q9HybM0+6OkQ5k7gXFmHnFTsr+EAmBJ5FFr6QZVI9n+oT+IdvIt2c8N6um3DmNU7 lHShMeDa89x97DpH2ovLQhRoU3dxhaEDf4sk6QtX+2EF7If+bip0IYG+K2uM4HZU nAa/T8irlN9AHT1VQ3zFkwZA6p3lbUD8fOzg97NITmhqmZbPWEBxOneBXY3EYf+w aolBlCq4wIUuw8/PZlFLFJ9m2OEjJSeQ1Z6YOJEH0NOkWGPa3evS1xDL+vVZA7dM bO+LcFnKnClGrMwaTKuOKXf7QszESkyEPHSpZWppLnC2VZRIbwvMiZyYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=JH/NDgHoQYhrolyZz9pQwD+Vgz7iCaEqmIN4USPEuEw=; b=IVZ7K43X BhUoffD3WMKeD0tmg4wEQXSSqbdTeWIcmD4SYdi9EsxPJM1OmCILM8uD5MJj9lko 5H2B1+U/J45gk5R9/iB2LoLAknQ9muxTAUsIF5zUERfdiIAgmVvvgMkLmal1VurD DRlKCfLnQ5xiCjOuHkv3MNfRPu+TmomsysWUROdMQQOiXPMxbhLmyFOSRszg5o/M MHwuWa1PHiQn0pG4isOKM1NRQrnJyt+86yPhNGxh9cvWm3jpvlrQ/z3htlfC1xuh VD7+JESdP3G7qOkpD7VeoBZAh9z6itVplSO7AJiD9/nrRizVTQ0gn8ozK8KjnBud XcBA+KEMdvhSlQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peeg X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 6B489E4210; Thu, 21 Feb 2019 01:29:30 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:08 +1030 Message-Id: <20190221062851.21958-10-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 09/52] test-ipmi-hiomap: Print some information on early scenario_exit() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Now we dump the index of the event that we exited on if it's not the appropriate scenario event type. Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 738352cc89f1..4e1232f22ed0 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -96,7 +96,12 @@ static void scenario_advance(void) static void scenario_exit(void) { - assert(ipmi_msg_ctx.cursor->type == scenario_sentinel); + if (ipmi_msg_ctx.cursor->type != scenario_sentinel) { + ptrdiff_t d = ipmi_msg_ctx.cursor - ipmi_msg_ctx.scenario; + printf("%s: Exiting on event %tu with event type %d \n", + __func__, d, ipmi_msg_ctx.cursor->type); + assert(false); + } } void ipmi_init_msg(struct ipmi_msg *msg, int interface __attribute__((unused)), From patchwork Thu Feb 21 06:28:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045787 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l5m16jDz9s6w for ; Thu, 21 Feb 2019 17:33:00 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="XJwtuoCM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="rCbj3SO2"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l5l72Z5zDqCW for ; Thu, 21 Feb 2019 17:32:59 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="XJwtuoCM"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="rCbj3SO2"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1s4lhNzDqND for ; Thu, 21 Feb 2019 17:29:37 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6E3672217B; Thu, 21 Feb 2019 01:29:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=JlKeOKTbHtH+N d/dG+sP5rqG/hLbxDeTfEjT2zmOIsc=; b=XJwtuoCMwtE8EF6VCMWdL2h+Z63U1 KLEsORtrEEEB/TDWiTVtMnooIQZXd6dYBNKTApbtcU6PBlEaFSR2+Q4XxmH9xWS+ rCOIaVStMeUwBpu94z0hFOfDFWmaG/TZxhQLo3dZRlUamt50Fw+QjIuB3JqBlbHV 2KUZA5yNCv6loW7fCuGa4ajxq8G1Xj1j7FXjGELN5IOq0lGEMAtWV+7iY8bwNg1K pJUV6RZc6XECbn1o28DMA7CRS8WpcqXZAwm9XK8X1iEP5UgsHPgFfNlZWOIDsHbB pJCCv1ILnPj/uNhtqkD9Zuz9j0Um6k3sQsAn3WnsxJ5uFBO3VUpiU8KUg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=JlKeOKTbHtH+Nd/dG+sP5rqG/hLbxDeTfEjT2zmOIsc=; b=rCbj3SO2 4zj8WLat5c5pCPxlxsICytCDHAKmQVXo8UBIbLg1D5jgTfys9VmPUAKSDCTd2HGV vP/qAYbacNQMef1bvn7Qd5TLAP+9XDvjymsr1miep+MPHGz4mGmQxznwWM8H2zaL CITKlSi8oHlxcQhgTvfrBlb4KLRpbrrFr0HOpeG7SWACMO8QwuI8JzW75jjA2tij vnG4ldXWw05H0dOQ++EqBNrPp/X5AO0d7s1zqCNwJZx87eU6NaY/UJnwWOUruQUs sCqvG+vtthlTgCUEcnk+DOHItYCtvSPBtS6zinNlZ3KDnZV7DsbE31jck/Vi9hq7 K0i1X0C5tgjLSQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peei X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 80C8DE419A; Thu, 21 Feb 2019 01:29:32 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:09 +1030 Message-Id: <20190221062851.21958-11-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 10/52] libflash/ipmi-hiomap: Fix leak of msg in callback X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery Reviewed-by: Vasant Hegde --- libflash/ipmi-hiomap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index ac47a1005ef8..4ab49d6d0d91 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -80,6 +80,7 @@ static void ipmi_hiomap_cmd_cb(struct ipmi_msg *msg) res->cc = msg->cc; if (msg->cc != IPMI_CC_NO_ERROR) { + ipmi_free_msg(msg); return; } From patchwork Thu Feb 21 06:28:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045788 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l622Nhbz9s6w for ; Thu, 21 Feb 2019 17:33:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="tz8fcCqF"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="cNHq2P/Z"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l6218wLzDqNd for ; Thu, 21 Feb 2019 17:33:14 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="tz8fcCqF"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="cNHq2P/Z"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1v3gQ3zDqNW for ; Thu, 21 Feb 2019 17:29:39 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 46FC12218B; Thu, 21 Feb 2019 01:29:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=pX4rmLqjWoXz0 Q1/Xt/cPPWGXoRWGXdoNXe8TACEXdY=; b=tz8fcCqFFNzYFteU+f1/Ow6VjFJs0 xhAue6x8UJjGKTLIIFjzfMd1odCC5KeDJWTjKcui8IJD4v8+t/NEDOA0r2/JKjpM qN/hFtfWerDS69Af/krKWgDrbxt6SiYsE5zSYZQrQMwUZKjoAzpvjpZCCe3239g3 cDVPjUmsLGijsgPXvK7acFZbnDdA6cMRDETqviV+jmIz8AIAd3o78UGbqhwrZ5vq Ul07zXO8mMz8IhhDADRZgxhNogf3dHln2Vi3Uwi6LvYslMYKdY83pq1xKFerrgEA 5sxFPt3pfVqedELNxBjEMPIYvQUx7AoM7wR0n5e9vj+ghCtVeX5xrjANQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=pX4rmLqjWoXz0Q1/Xt/cPPWGXoRWGXdoNXe8TACEXdY=; b=cNHq2P/Z e8xVJafzvtmFkfBHI1r8bWqFWhGprqTMol2XGlWWv8WTHFj/M6ZOTn4d9va24SOn eiDc5ONUiVf1Le7d8e976GJKpHxSgyQOvoD2c9iPNvHBt2wbCFjm1g5Gg1SNVlCp NGkmJiBipx4JZISqagVQluE8BdL1CsS7z/QySfv+1Pe0mE2qTQUaA3lwi2iEwlcP cGAML3g5ldEff5irRVhOOq8Hsfu9FjEGCx5OC46BjdG6jlRt84VtoSsqhKKXJU0+ VKvBltLvB31jVmoi7Pg958ml/eIO69Y/PImHVIHfQcHO8irK6RL/bP/yhyi5umTh Ib3tODZMM+rToA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peei X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id B42DEE419A; Thu, 21 Feb 2019 01:29:34 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:10 +1030 Message-Id: <20190221062851.21958-12-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 11/52] libflash/ipmi-hiomap: Overhaul error handling X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The aim is to improve the robustness with respect to absence of the BMC-side daemon. The current error handling roughly mirrors what was done for the mailbox implementation, but there's room for improvement. Errors are split into two classes, those that affect the transport state and those that affect the window validity. From here, we push the transport state error checks right to the bottom of the stack, to ensure the link is known to be in a good state before any message is sent. Window validity tests remain as they were in the hiomap_window_move() and ipmi_hiomap_read() functions. Validity tests are not necessary in the write and erase paths as we will receive an error response from the BMC when performing a dirty or flush on an invalid window. Recovery also remains as it was, done on entry to the blocklevel callbacks. If an error state is encountered in the middle of an operation no attempt is made to recover it on the spot, instead the error is returned up the stack and the caller can choose how it wishes to respond. Cc: stable Signed-off-by: Andrew Jeffery --- libflash/ipmi-hiomap.c | 310 ++++++++++++++++++++++++++--------------- 1 file changed, 200 insertions(+), 110 deletions(-) diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index 4ab49d6d0d91..3eeadc90da3e 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -49,30 +49,61 @@ static inline uint16_t bytes_to_blocks(struct ipmi_hiomap *ctx, uint32_t bytes) return bytes >> ctx->block_size_shift; } -/* Is the current window able perform the complete operation */ -static bool hiomap_window_valid(struct ipmi_hiomap *ctx, uint64_t pos, +/* Call under ctx->lock */ +static int hiomap_protocol_ready(struct ipmi_hiomap *ctx) +{ + if (!(ctx->bmc_state & HIOMAP_E_DAEMON_READY)) + return FLASH_ERR_DEVICE_GONE; + if (ctx->bmc_state & HIOMAP_E_FLASH_LOST) + return FLASH_ERR_AGAIN; + + return 0; +} + +static int hiomap_queue_msg_sync(struct ipmi_hiomap *ctx, struct ipmi_msg *msg) +{ + int rc; + + /* + * There's an unavoidable TOCTOU race here with the BMC sending an + * event saying it's no-longer available right after we test but before + * we call into the IPMI stack to send the message. + * hiomap_queue_msg_sync() exists to capture the race in a single + * location. + */ + lock(&ctx->lock); + rc = hiomap_protocol_ready(ctx); + unlock(&ctx->lock); + if (rc) { + ipmi_free_msg(msg); + return rc; + } + + ipmi_queue_msg_sync(msg); + + return 0; +} + +/* Call under ctx->lock */ +static int hiomap_window_valid(struct ipmi_hiomap *ctx, uint64_t pos, uint64_t len) { - enum lpc_window_state window_state; - uint8_t bmc_state; + if (ctx->bmc_state & HIOMAP_E_FLASH_LOST) + return FLASH_ERR_AGAIN; + if (ctx->bmc_state & HIOMAP_E_PROTOCOL_RESET) + return FLASH_ERR_AGAIN; + if (ctx->bmc_state & HIOMAP_E_WINDOW_RESET) + return FLASH_ERR_AGAIN; + if (ctx->window_state == closed_window) + return FLASH_ERR_PARM_ERROR; + if (pos < ctx->current.cur_pos) + return FLASH_ERR_PARM_ERROR; + if ((pos + len) > (ctx->current.cur_pos + ctx->current.size)) + return FLASH_ERR_PARM_ERROR; - lock(&ctx->lock); - bmc_state = ctx->bmc_state; - window_state = ctx->window_state; - unlock(&ctx->lock); - - if (bmc_state & HIOMAP_E_FLASH_LOST) - return false; - if (window_state == closed_window) - return false; - if (pos < ctx->current.cur_pos) /* start */ - return false; - if ((pos + len) > (ctx->current.cur_pos + ctx->current.size)) /* end */ - return false; - return true; + return 0; } - static void ipmi_hiomap_cmd_cb(struct ipmi_msg *msg) { struct ipmi_hiomap_result *res = msg->user_data; @@ -156,6 +187,7 @@ static void ipmi_hiomap_cmd_cb(struct ipmi_msg *msg) } parms = (struct hiomap_v2_create_window *)&msg->data[2]; + ctx->current.lpc_addr = blocks_to_bytes(ctx, le16_to_cpu(parms->lpc_addr)); ctx->current.size = @@ -190,13 +222,23 @@ static void ipmi_hiomap_cmd_cb(struct ipmi_msg *msg) ipmi_free_msg(msg); } -static bool hiomap_get_info(struct ipmi_hiomap *ctx) +static void hiomap_init(struct ipmi_hiomap *ctx) +{ + /* + * Speculatively mark the daemon as available so we attempt to perform + * the handshake without immediately bailing out. + */ + lock(&ctx->lock); + ctx->bmc_state = HIOMAP_E_DAEMON_READY; + unlock(&ctx->lock); +} + +static int hiomap_get_info(struct ipmi_hiomap *ctx) { RESULT_INIT(res, ctx); unsigned char req[3]; struct ipmi_msg *msg; - - ctx->bmc_state = 0; + int rc; /* Negotiate protocol version 2 */ req[0] = HIOMAP_C_GET_INFO; @@ -206,43 +248,46 @@ static bool hiomap_get_info(struct ipmi_hiomap *ctx) msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, bmc_platform->sw->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 6); - ipmi_queue_msg_sync(msg); + + rc = hiomap_queue_msg_sync(ctx, msg); + if (rc) + return rc; if (res.cc != IPMI_CC_NO_ERROR) { prerror("%s failed: %d\n", __func__, res.cc); - return false; + return FLASH_ERR_PARM_ERROR; /* XXX: Find something better? */ } - lock(&ctx->lock); - ctx->bmc_state |= HIOMAP_E_DAEMON_READY; - unlock(&ctx->lock); - - return true; + return 0; } -static bool hiomap_get_flash_info(struct ipmi_hiomap *ctx) +static int hiomap_get_flash_info(struct ipmi_hiomap *ctx) { RESULT_INIT(res, ctx); unsigned char req[2]; struct ipmi_msg *msg; + int rc; req[0] = HIOMAP_C_GET_FLASH_INFO; req[1] = ++ctx->seq; msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, bmc_platform->sw->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2 + 2 + 2); - ipmi_queue_msg_sync(msg); + + rc = hiomap_queue_msg_sync(ctx, msg); + if (rc) + return rc; if (res.cc != IPMI_CC_NO_ERROR) { prerror("%s failed: %d\n", __func__, res.cc); - return false; + return FLASH_ERR_PARM_ERROR; /* XXX: Find something better? */ } - return true; + return 0; } -static bool hiomap_window_move(struct ipmi_hiomap *ctx, uint8_t command, - uint64_t pos, uint64_t len, uint64_t *size) +static int hiomap_window_move(struct ipmi_hiomap *ctx, uint8_t command, + uint64_t pos, uint64_t len, uint64_t *size) { enum lpc_window_state want_state; struct hiomap_v2_range *range; @@ -251,15 +296,25 @@ static bool hiomap_window_move(struct ipmi_hiomap *ctx, uint8_t command, struct ipmi_msg *msg; bool valid_state; bool is_read; + int rc; is_read = (command == HIOMAP_C_CREATE_READ_WINDOW); want_state = is_read ? read_window : write_window; + + lock(&ctx->lock); + valid_state = want_state == ctx->window_state; - if (valid_state && hiomap_window_valid(ctx, pos, len)) { + rc = hiomap_window_valid(ctx, pos, len); + if (valid_state && !rc) { + unlock(&ctx->lock); *size = len; - return true; + return 0; } + ctx->window_state = closed_window; + + unlock(&ctx->lock); + req[0] = command; req[1] = ++ctx->seq; @@ -267,21 +322,21 @@ static bool hiomap_window_move(struct ipmi_hiomap *ctx, uint8_t command, range->offset = cpu_to_le16(bytes_to_blocks(ctx, pos)); range->size = cpu_to_le16(bytes_to_blocks(ctx, len)); - lock(&ctx->lock); - ctx->window_state = closed_window; - unlock(&ctx->lock); - msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, bmc_platform->sw->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2 + 2 + 2 + 2); - ipmi_queue_msg_sync(msg); + + rc = hiomap_queue_msg_sync(ctx, msg); + if (rc) + return rc; if (res.cc != IPMI_CC_NO_ERROR) { prlog(PR_INFO, "%s failed: %d\n", __func__, res.cc); - return false; + return FLASH_ERR_PARM_ERROR; /* XXX: Find something better? */ } + lock(&ctx->lock); *size = len; /* Is length past the end of the window? */ if ((pos + len) > (ctx->current.cur_pos + ctx->current.size)) @@ -289,19 +344,22 @@ static bool hiomap_window_move(struct ipmi_hiomap *ctx, uint8_t command, *size = (ctx->current.cur_pos + ctx->current.size) - pos; if (len != 0 && *size == 0) { + unlock(&ctx->lock); prerror("Invalid window properties: len: %"PRIu64", size: %"PRIu64"\n", len, *size); - return false; + return FLASH_ERR_PARM_ERROR; } prlog(PR_DEBUG, "Opened %s window from 0x%x for %u bytes at 0x%x\n", (command == HIOMAP_C_CREATE_READ_WINDOW) ? "read" : "write", ctx->current.cur_pos, ctx->current.size, ctx->current.lpc_addr); - return true; + unlock(&ctx->lock); + + return 0; } -static bool hiomap_mark_dirty(struct ipmi_hiomap *ctx, uint64_t offset, +static int hiomap_mark_dirty(struct ipmi_hiomap *ctx, uint64_t offset, uint64_t size) { struct hiomap_v2_range *range; @@ -310,13 +368,14 @@ static bool hiomap_mark_dirty(struct ipmi_hiomap *ctx, uint64_t offset, unsigned char req[6]; struct ipmi_msg *msg; uint32_t pos; + int rc; lock(&ctx->lock); state = ctx->window_state; unlock(&ctx->lock); if (state != write_window) - return false; + return FLASH_ERR_PARM_ERROR; req[0] = HIOMAP_C_MARK_DIRTY; req[1] = ++ctx->seq; @@ -329,32 +388,36 @@ static bool hiomap_mark_dirty(struct ipmi_hiomap *ctx, uint64_t offset, msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, bmc_platform->sw->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2); - ipmi_queue_msg_sync(msg); + + rc = hiomap_queue_msg_sync(ctx, msg); + if (rc) + return rc; if (res.cc != IPMI_CC_NO_ERROR) { prerror("%s failed: %d\n", __func__, res.cc); - return false; + return FLASH_ERR_PARM_ERROR; } prlog(PR_DEBUG, "Marked flash dirty at 0x%" PRIx64 " for %" PRIu64 "\n", offset, size); - return true; + return 0; } -static bool hiomap_flush(struct ipmi_hiomap *ctx) +static int hiomap_flush(struct ipmi_hiomap *ctx) { enum lpc_window_state state; RESULT_INIT(res, ctx); unsigned char req[2]; struct ipmi_msg *msg; + int rc; lock(&ctx->lock); state = ctx->window_state; unlock(&ctx->lock); if (state != write_window) - return false; + return FLASH_ERR_PARM_ERROR; req[0] = HIOMAP_C_FLUSH; req[1] = ++ctx->seq; @@ -362,23 +425,27 @@ static bool hiomap_flush(struct ipmi_hiomap *ctx) msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, bmc_platform->sw->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2); - ipmi_queue_msg_sync(msg); + + rc = hiomap_queue_msg_sync(ctx, msg); + if (rc) + return rc; if (res.cc != IPMI_CC_NO_ERROR) { prerror("%s failed: %d\n", __func__, res.cc); - return false; + return FLASH_ERR_PARM_ERROR; } prlog(PR_DEBUG, "Flushed writes\n"); - return true; + return 0; } -static bool hiomap_ack(struct ipmi_hiomap *ctx, uint8_t ack) +static int hiomap_ack(struct ipmi_hiomap *ctx, uint8_t ack) { RESULT_INIT(res, ctx); unsigned char req[3]; struct ipmi_msg *msg; + int rc; req[0] = HIOMAP_C_ACK; req[1] = ++ctx->seq; @@ -387,19 +454,22 @@ static bool hiomap_ack(struct ipmi_hiomap *ctx, uint8_t ack) msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, bmc_platform->sw->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2); - ipmi_queue_msg_sync(msg); + + rc = hiomap_queue_msg_sync(ctx, msg); + if (rc) + return rc; if (res.cc != IPMI_CC_NO_ERROR) { prlog(PR_DEBUG, "%s failed: %d\n", __func__, res.cc); - return false; + return FLASH_ERR_PARM_ERROR; } prlog(PR_DEBUG, "Acked events: 0x%x\n", ack); - return true; + return 0; } -static bool hiomap_erase(struct ipmi_hiomap *ctx, uint64_t offset, +static int hiomap_erase(struct ipmi_hiomap *ctx, uint64_t offset, uint64_t size) { struct hiomap_v2_range *range; @@ -408,13 +478,14 @@ static bool hiomap_erase(struct ipmi_hiomap *ctx, uint64_t offset, unsigned char req[6]; struct ipmi_msg *msg; uint32_t pos; + int rc; lock(&ctx->lock); state = ctx->window_state; unlock(&ctx->lock); if (state != write_window) - return false; + return FLASH_ERR_PARM_ERROR; req[0] = HIOMAP_C_ERASE; req[1] = ++ctx->seq; @@ -427,17 +498,19 @@ static bool hiomap_erase(struct ipmi_hiomap *ctx, uint64_t offset, msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, bmc_platform->sw->ipmi_oem_hiomap_cmd, ipmi_hiomap_cmd_cb, &res, req, sizeof(req), 2); - ipmi_queue_msg_sync(msg); + rc = hiomap_queue_msg_sync(ctx, msg); + if (rc) + return rc; if (res.cc != IPMI_CC_NO_ERROR) { prerror("%s failed: %d\n", __func__, res.cc); - return false; + return FLASH_ERR_PARM_ERROR; } prlog(PR_DEBUG, "Erased flash at 0x%" PRIx64 " for %" PRIu64 "\n", offset, size); - return true; + return 0; } static void hiomap_event(uint8_t events, void *context) @@ -537,7 +610,7 @@ static int lpc_window_write(struct ipmi_hiomap *ctx, uint32_t pos, } /* Try to restore the window state */ -static bool ipmi_hiomap_restore_window(struct ipmi_hiomap *ctx) +static int ipmi_hiomap_restore_window(struct ipmi_hiomap *ctx) { uint64_t size; uint8_t cmd; @@ -545,7 +618,7 @@ static bool ipmi_hiomap_restore_window(struct ipmi_hiomap *ctx) lock(&ctx->lock); if (ctx->window_state == closed_window) { unlock(&ctx->lock); - return true; + return 0; } cmd = ctx->window_state == read_window ? @@ -564,6 +637,7 @@ static int ipmi_hiomap_handle_events(struct ipmi_hiomap *ctx) { uint8_t status; bool update; + int rc; lock(&ctx->lock); status = ctx->bmc_state; @@ -584,10 +658,11 @@ static int ipmi_hiomap_handle_events(struct ipmi_hiomap *ctx) if (status & HIOMAP_E_ACK_MASK) { /* ACK is unversioned, can send it if the daemon is ready */ - if (!hiomap_ack(ctx, status & HIOMAP_E_ACK_MASK)) { + rc = hiomap_ack(ctx, status & HIOMAP_E_ACK_MASK); + if (rc) { prlog(PR_DEBUG, "Failed to ack events: 0x%x\n", status & HIOMAP_E_ACK_MASK); - return FLASH_ERR_AGAIN; + return rc; } } @@ -599,19 +674,22 @@ static int ipmi_hiomap_handle_events(struct ipmi_hiomap *ctx) if (status & HIOMAP_E_PROTOCOL_RESET) { prlog(PR_INFO, "Protocol was reset\n"); - if (!hiomap_get_info(ctx)) { + rc = hiomap_get_info(ctx); + if (rc) { prerror("Failure to renegotiate after protocol reset\n"); - return FLASH_ERR_DEVICE_GONE; + return rc; } - if (!hiomap_get_flash_info(ctx)) { + rc = hiomap_get_flash_info(ctx); + if (rc) { prerror("Failure to fetch flash info after protocol reset\n"); - return FLASH_ERR_DEVICE_GONE; + return rc; } - if (!ipmi_hiomap_restore_window(ctx)) { + rc = ipmi_hiomap_restore_window(ctx); + if (rc) { prerror("Failure to restore window state after protocol reset\n"); - return FLASH_ERR_DEVICE_GONE; + return rc; } prlog(PR_INFO, "Restored window state after protocol reset\n"); @@ -621,9 +699,10 @@ static int ipmi_hiomap_handle_events(struct ipmi_hiomap *ctx) if (status & HIOMAP_E_WINDOW_RESET) { prlog(PR_INFO, "Window was reset\n"); - if (!ipmi_hiomap_restore_window(ctx)) { + rc = ipmi_hiomap_restore_window(ctx); + if (rc) { prerror("Failed to restore previous window parameters after protocol reset\n"); - return FLASH_ERR_DEVICE_GONE; + return rc; } prlog(PR_INFO, "Restored window state after window reset\n"); @@ -653,9 +732,10 @@ static int ipmi_hiomap_read(struct blocklevel_device *bl, uint64_t pos, len); while (len > 0) { /* Move window and get a new size to read */ - if (!hiomap_window_move(ctx, HIOMAP_C_CREATE_READ_WINDOW, pos, - len, &size)) - return FLASH_ERR_PARM_ERROR; + rc = hiomap_window_move(ctx, HIOMAP_C_CREATE_READ_WINDOW, pos, + len, &size); + if (rc) + return rc; /* Perform the read for this window */ rc = lpc_window_read(ctx, pos, buf, size); @@ -663,8 +743,11 @@ static int ipmi_hiomap_read(struct blocklevel_device *bl, uint64_t pos, return rc; /* Check we can trust what we read */ - if (!hiomap_window_valid(ctx, pos, size)) - return FLASH_ERR_AGAIN; + lock(&ctx->lock); + rc = hiomap_window_valid(ctx, pos, size); + unlock(&ctx->lock); + if (rc) + return rc; len -= size; pos += size; @@ -695,17 +778,19 @@ static int ipmi_hiomap_write(struct blocklevel_device *bl, uint64_t pos, len); while (len > 0) { /* Move window and get a new size to read */ - if (!hiomap_window_move(ctx, HIOMAP_C_CREATE_WRITE_WINDOW, pos, - len, &size)) - return FLASH_ERR_PARM_ERROR; + rc = hiomap_window_move(ctx, HIOMAP_C_CREATE_WRITE_WINDOW, pos, + len, &size); + if (rc) + return rc; /* Perform the write for this window */ rc = lpc_window_write(ctx, pos, buf, size); if (rc) return rc; - if (!hiomap_mark_dirty(ctx, pos, size)) - return FLASH_ERR_PARM_ERROR; + rc = hiomap_mark_dirty(ctx, pos, size); + if (rc) + return rc; /* * The BMC *should* flush if the window is implicitly closed, @@ -713,8 +798,9 @@ static int ipmi_hiomap_write(struct blocklevel_device *bl, uint64_t pos, * * XXX: Removing this could improve performance */ - if (!hiomap_flush(ctx)) - return FLASH_ERR_PARM_ERROR; + rc = hiomap_flush(ctx); + if (rc) + return rc; len -= size; pos += size; @@ -745,20 +831,22 @@ static int ipmi_hiomap_erase(struct blocklevel_device *bl, uint64_t pos, uint64_t size; /* Move window and get a new size to erase */ - if (!hiomap_window_move(ctx, HIOMAP_C_CREATE_WRITE_WINDOW, pos, - len, &size)) - return FLASH_ERR_PARM_ERROR; + rc = hiomap_window_move(ctx, HIOMAP_C_CREATE_WRITE_WINDOW, pos, + len, &size); + if (rc) + return rc; - if (!hiomap_erase(ctx, pos, size)) - return FLASH_ERR_PARM_ERROR; + rc = hiomap_erase(ctx, pos, size); + if (rc) + return rc; /* * Flush directly, don't mark that region dirty otherwise it * isn't clear if a write happened there or not */ - - if (!hiomap_flush(ctx)) - return FLASH_ERR_PARM_ERROR; + rc = hiomap_flush(ctx); + if (rc) + return rc; len -= size; pos += size; @@ -780,9 +868,9 @@ static int ipmi_hiomap_get_flash_info(struct blocklevel_device *bl, if (rc) return rc; - if (!hiomap_get_flash_info(ctx)) { - return FLASH_ERR_DEVICE_GONE; - } + rc = hiomap_get_flash_info(ctx); + if (rc) + return rc; ctx->bl.erase_mask = ctx->erase_granule - 1; @@ -821,29 +909,31 @@ int ipmi_hiomap_init(struct blocklevel_device **bl) ctx->bl.erase = &ipmi_hiomap_erase; ctx->bl.get_info = &ipmi_hiomap_get_flash_info; - rc = ipmi_sel_register(CMD_OP_HIOMAP_EVENT, hiomap_event, ctx); - if (rc < 0) - goto err; + hiomap_init(ctx); /* Ack all pending ack-able events to avoid spurious failures */ - if (!hiomap_ack(ctx, HIOMAP_E_ACK_MASK)) { + rc = hiomap_ack(ctx, HIOMAP_E_ACK_MASK); + if (rc) { prlog(PR_DEBUG, "Failed to ack events: 0x%x\n", HIOMAP_E_ACK_MASK); - rc = FLASH_ERR_AGAIN; goto err; } + rc = ipmi_sel_register(CMD_OP_HIOMAP_EVENT, hiomap_event, ctx); + if (rc < 0) + goto err; + /* Negotiate protocol behaviour */ - if (!hiomap_get_info(ctx)) { - prerror("Failed to get hiomap parameters\n"); - rc = FLASH_ERR_DEVICE_GONE; + rc = hiomap_get_info(ctx); + if (rc) { + prerror("Failed to get hiomap parameters: %d\n", rc); goto err; } /* Grab the flash parameters */ - if (!hiomap_get_flash_info(ctx)) { - prerror("Failed to get flash parameters\n"); - rc = FLASH_ERR_DEVICE_GONE; + rc = hiomap_get_flash_info(ctx); + if (rc) { + prerror("Failed to get flash parameters: %d\n", rc); goto err; } From patchwork Thu Feb 21 06:28:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045789 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l6H3jF4z9s6w for ; Thu, 21 Feb 2019 17:33:27 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="S+gvd6Qt"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="aa56OTXW"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l6H2S2jzDq6X for ; Thu, 21 Feb 2019 17:33:27 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="S+gvd6Qt"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="aa56OTXW"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1x3wxwzDqNF for ; Thu, 21 Feb 2019 17:29:41 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 22B892217B; Thu, 21 Feb 2019 01:29:39 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=me5qduaAP882J aUFvb66z/AvGQ/RmBviI83ODPtCw3c=; b=S+gvd6Qt2smR4FPFOm85RD9SduqpR zfuB6hJ/4bOFk2Psj2tLCau9HBiyXSSxOPZOWGI9A+LjIHZMFJI8R7QVsiu0aBG5 AzMj/+xRX4JFTvmHm/u1plwOTSyKMOwJrhjtd3Pywrh/7gl2t5d+65VzgTz9yCRW pqCsj0N0XHrQBZ9DKFRAIiefGSpAE+X6dYpMiAIm3+8elWwIrNYUAU1Q5lVh/tdI Hp3SKS83YRtYr0DApr5i7Sw6TGkWkG4ppEdpaOwibxxaKyfirkdpiQfQ9MtYudOC fmcjWTcaNGdz3PtfJ+Idv/t6e2iquGcrQkJGi2EvMMv6jmPrJiQTFFXNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=me5qduaAP882JaUFvb66z/AvGQ/RmBviI83ODPtCw3c=; b=aa56OTXW UdytZMhHI3Wmc79AMIw6qjIakYVl95c9mh50YRJRm+IlQ/T4AfHTIZHYeyJHtOso cMtfHHSIIHhKCh5M+3vM7nLBLsCges5piW0hCRFV8lPdw+zqK61h9qvkl+bdsnHA DEFlHC/ze2tv8T1KTzrUSeeyp893rd7lC7psdJuvPz7SwN9ExOMLi0SL4jLJI3Va nOe0odnTRA5whf1oYc0sJ6vk0qjJQLt+ne6OBJpeSjgZFTM7L3BOsXmiZ3Z7WFXH 1MvjZ910fw2NdYp6Chl5qmF1tIBVucXW+8dts94wXGZKoP+K2zVcG8i0jyKytJL0 2LNOT69waZPjIA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peei X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 6B428E419A; Thu, 21 Feb 2019 01:29:37 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:11 +1030 Message-Id: <20190221062851.21958-13-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 12/52] libflash/ipmi-hiomap: Overhaul event handling X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Reworking the event handling was inspired by a bug report by Vasant where the host would get wedged on multiple flash access attempts in the face of a persistent error state on the BMC-side. The cause of this bug was the early-exit based on ctx->update, which erronously assumed that all events had been completely handled in prior calls to ipmi_hiomap_handle_events(). This is not true if e.g. HIOMAP_E_DAEMON_READY is clear in the prior calls. Regardless, there were other correctness and efficiency problems with the handling strategy: * Ack-able event state was not restored in the face of errors in the process of re-establishing protocol state * It forced needless window restoration with respect to the context in which ipmi_hiomap_handle_events() was called. * Tests for HIOMAP_E_DAEMON_READY and HIOMAP_E_FLASH_LOST were redundant with the overhauled error handling introduced in the previous patch Fix all of the above issues and add comments to explain the event handling flow. Tests for correctness follow later in the series. Cc: stable Cc: Vasant Hegde Signed-off-by: Andrew Jeffery --- libflash/ipmi-hiomap.c | 125 ++++++++++++++++++++--------------------- libflash/ipmi-hiomap.h | 1 - 2 files changed, 60 insertions(+), 66 deletions(-) diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index 3eeadc90da3e..fdd12d5754e2 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -521,7 +521,6 @@ static void hiomap_event(uint8_t events, void *context) lock(&ctx->lock); ctx->bmc_state = events | (ctx->bmc_state & HIOMAP_E_ACK_MASK); - ctx->update = true; unlock(&ctx->lock); } @@ -609,106 +608,102 @@ static int lpc_window_write(struct ipmi_hiomap *ctx, uint32_t pos, return 0; } -/* Try to restore the window state */ -static int ipmi_hiomap_restore_window(struct ipmi_hiomap *ctx) -{ - uint64_t size; - uint8_t cmd; - - lock(&ctx->lock); - if (ctx->window_state == closed_window) { - unlock(&ctx->lock); - return 0; - } - - cmd = ctx->window_state == read_window ? - HIOMAP_C_CREATE_READ_WINDOW : - HIOMAP_C_CREATE_WRITE_WINDOW; - - ctx->window_state = closed_window; - unlock(&ctx->lock); - - return hiomap_window_move(ctx, cmd, ctx->current.cur_pos, - ctx->current.size, &size); -} - /* Best-effort asynchronous event handling by blocklevel callbacks */ static int ipmi_hiomap_handle_events(struct ipmi_hiomap *ctx) { uint8_t status; - bool update; int rc; lock(&ctx->lock); + status = ctx->bmc_state; - update = ctx->update; - if (update) { - ctx->bmc_state &= ~HIOMAP_E_ACK_MASK; - ctx->update = false; - } + + /* + * Immediately clear the ackable events to make sure we don't race to + * clear them after dropping the lock, as we may lose protocol or + * window state if a race materialises. In the event of a failure where + * we haven't completed the recovery, the state we mask out below gets + * OR'ed back in to avoid losing it. + */ + ctx->bmc_state &= ~HIOMAP_E_ACK_MASK; + + /* + * We won't be attempting to restore window state - + * ipmi_hiomap_handle_events() is followed by hiomap_window_move() in + * all cases. Attempting restoration after HIOMAP_E_PROTOCOL_RESET or + * HIOMAP_E_WINDOW_RESET can be wasteful if we immediately shift the + * window elsewhere, and if it does not need to be shifted with respect + * to the subsequent request then hiomap_window_move() will handle + * re-opening it from the closed state. + * + * Therefore it is enough to mark the window as closed to consider it + * recovered. + */ + if (status & (HIOMAP_E_PROTOCOL_RESET | HIOMAP_E_WINDOW_RESET)) + ctx->window_state = closed_window; + unlock(&ctx->lock); - if (!update) - return 0; - - if (!(status & HIOMAP_E_DAEMON_READY)) { - prerror("Daemon not ready\n"); - return FLASH_ERR_DEVICE_GONE; - } - + /* + * If there's anything to acknowledge, do so in the one request to + * minimise overhead. By sending the ACK prior to performing the + * protocol recovery we ensure that even with coalesced resets we still + * end up in the recovered state and not unknowingly stuck in a reset + * state. We may receive reset events after the ACK but prior to the + * recovery procedures being run, but this just means that we will + * needlessly perform recovery on the following invocation of + * ipmi_hiomap_handle_events(). If the reset event is a + * HIOMAP_E_WINDOW_RESET it is enough that the window is already marked + * as closed above - future accesses will force it to be re-opened and + * the BMC's cache must be valid if opening the window is successful. + */ if (status & HIOMAP_E_ACK_MASK) { /* ACK is unversioned, can send it if the daemon is ready */ rc = hiomap_ack(ctx, status & HIOMAP_E_ACK_MASK); if (rc) { prlog(PR_DEBUG, "Failed to ack events: 0x%x\n", status & HIOMAP_E_ACK_MASK); - return rc; + goto restore; } } - if (status & HIOMAP_E_FLASH_LOST) { - prlog(PR_INFO, "Lost control of flash device\n"); - return FLASH_ERR_AGAIN; - } - if (status & HIOMAP_E_PROTOCOL_RESET) { prlog(PR_INFO, "Protocol was reset\n"); rc = hiomap_get_info(ctx); if (rc) { prerror("Failure to renegotiate after protocol reset\n"); - return rc; + goto restore; } rc = hiomap_get_flash_info(ctx); if (rc) { prerror("Failure to fetch flash info after protocol reset\n"); - return rc; + goto restore; } - rc = ipmi_hiomap_restore_window(ctx); - if (rc) { - prerror("Failure to restore window state after protocol reset\n"); - return rc; - } - - prlog(PR_INFO, "Restored window state after protocol reset\n"); - return 0; + prlog(PR_INFO, "Restored state after protocol reset\n"); } - if (status & HIOMAP_E_WINDOW_RESET) { - prlog(PR_INFO, "Window was reset\n"); - - rc = ipmi_hiomap_restore_window(ctx); - if (rc) { - prerror("Failed to restore previous window parameters after protocol reset\n"); - return rc; - } - - prlog(PR_INFO, "Restored window state after window reset\n"); - } + /* + * As there's no change to the protocol on HIOMAP_E_WINDOW_RESET we + * simply need to open a window to recover, which as mentioned above is + * handled by hiomap_window_move() after our cleanup here. + */ return 0; + +restore: + /* + * Conservatively restore the events to the un-acked state to avoid + * losing events due to races. It might cause us to restore state more + * than necessary, but never less than necessary. + */ + lock(&ctx->lock); + ctx->bmc_state |= (status & HIOMAP_E_ACK_MASK); + unlock(&ctx->lock); + + return rc; } static int ipmi_hiomap_read(struct blocklevel_device *bl, uint64_t pos, diff --git a/libflash/ipmi-hiomap.h b/libflash/ipmi-hiomap.h index f60f725d2ef0..edd4ee0a364f 100644 --- a/libflash/ipmi-hiomap.h +++ b/libflash/ipmi-hiomap.h @@ -48,7 +48,6 @@ struct ipmi_hiomap { * three variables are protected by lock to avoid conflict. */ struct lock lock; - bool update; uint8_t bmc_state; enum lpc_window_state window_state; }; From patchwork Thu Feb 21 06:28:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045790 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l6Z6JKwz9s6w for ; Thu, 21 Feb 2019 17:33:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="AvVBsgVN"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="R/FJvmOS"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l6Z5C1mzDqNZ for ; Thu, 21 Feb 2019 17:33:42 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="AvVBsgVN"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="R/FJvmOS"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l1z5FbgzDqNJ for ; Thu, 21 Feb 2019 17:29:43 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 745E022167; Thu, 21 Feb 2019 01:29:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=FcTesTmHGyyUh nS13navH2hAs0/zu7bgOTTguOmJmjE=; b=AvVBsgVNMLaxjBN7VVF7tL4RWAkJi n8cmpfQjibxOmGdGHrQwR8TcpuzFQol4N/0tByks54G3s8dscf5bPeBSurIypfP+ GL3bEHsdSPtYN521lEhZTacxEBu23cJSItvPHpkaBeuFEKlzIF9+Eb+M+dmIxgLo hu9AfuIZzgl9g+oVCMzxn6GiOblax1eP+o0qdLyE/a8/BqecX174RsgMKIhU8EjU HQ3c1G02tQ1wOBaN21185IaI5/hkeCKMsPpGX+149H/arW3aiqxRQ+a4PWBWCf4r SPCxkZRSQ/Q6LCJRtOnd2NoAKmctnxqXh+PbUw4/2sDZyriKzvcYP9kJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=FcTesTmHGyyUhnS13navH2hAs0/zu7bgOTTguOmJmjE=; b=R/FJvmOS f0B55n0BRE9ovBpLix7qQINYSSIdUGP7IE3NpC1vU7OmrJCPQJN8xpAytUXk7Xat flJbWeM8XW3PGmNUdgtONV5+Blpg9aB06gMgIii4VyY+1eG+oR21wCRnUZwti+Nl hTJdtPaeYJODJTtvvGjEHdxDTGtXF4KD5DatCqn0u/3YUHVyY8pHZoi9V6fVlTvM Jz0rGlsBK1g3guUS5qmkNms+jRvY7tEtXQQs/RekBrL9SI8KCngTl15vYdLVvX/V felPRQaYBUMsyHy9I7jOgoFIceAXxXgrvX6MzVMnGX5g5wwQX/5bpqtgC+ftWQ+2 yhdeJ5l9wze5+Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peel X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 9B641E419A; Thu, 21 Feb 2019 01:29:39 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:12 +1030 Message-Id: <20190221062851.21958-14-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 13/52] libflash/ipmi-hiomap: Remove unused close handling X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Issuing a HIOMAP_C_CLOSE is not required by the protocol specification, rather a close can be implicit in a subsequent CREATE_{READ,WRITE}_WINDOW request. The implicit close provides an opportunity to reduce LPC traffic and the implementation takes up that optimisation, so remove the case from the IPMI callback handler. Cc: stable Signed-off-by: Andrew Jeffery --- libflash/ipmi-hiomap.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index fdd12d5754e2..7a36449a5d0b 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -204,11 +204,6 @@ static void ipmi_hiomap_cmd_cb(struct ipmi_msg *msg) break; } - case HIOMAP_C_CLOSE_WINDOW: - lock(&ctx->lock); - ctx->window_state = closed_window; - unlock(&ctx->lock); - break; case HIOMAP_C_MARK_DIRTY: case HIOMAP_C_FLUSH: case HIOMAP_C_ACK: From patchwork Thu Feb 21 06:28:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045791 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l6s1gmXz9s8m for ; Thu, 21 Feb 2019 17:33:57 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="sL0fNdtL"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nPWOCPsU"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l6s0GnZzDqNQ for ; Thu, 21 Feb 2019 17:33:57 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="sL0fNdtL"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nPWOCPsU"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l220KH5zDqNV for ; Thu, 21 Feb 2019 17:29:46 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A1E992217B; Thu, 21 Feb 2019 01:29:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=wjzvtFV+TTlIP ENkoC4LHwqb2AeWyGzILWgJ+5FjBL0=; b=sL0fNdtLkOOp2DP1RRdoBR1/QdxQM ZoffdihTqfllYzgg7YuXeAXLGvhXYXl1YRq3I1nLLp3bTaWME6AZVunD8gvrs/LJ zwB3AAjh/uGLN9X8rPrOVIxPieyx1bL9EeDlM4DinTNoM/RR6vBqerHUCpsaL3be Lw4xsOUr36e3zaleQ48vabs4VsfsEOl+8sUeUHAtjE9bndYU/y17F5ZksLXUiF7Q wWTtpMFwR9rKFhj4eD21YUqfPYdEoF2SGfMbuSI+YhmZDgfwSntDXq0pxQFAspqD QCtX8aWtwp4a6TG/57vaEW1/qIoIZ+JiaIveXmFLJTJMJzGb40hJMB6cw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=wjzvtFV+TTlIPENkoC4LHwqb2AeWyGzILWgJ+5FjBL0=; b=nPWOCPsU Pqpyjhu2+0Amni+n9U7Wr/wJeNIaxXHokgWxGYFRoCa8lBKu4yvFaBtq/u9KM9ic 9sj2rSJoyJR2kz4APUEN7qcKqEh+iUg7ALlJN3WTjIrqu5JtLK2oQSa+h/vLoxu0 f9KAi1cIV1aczvv7Gv9saU7FG/pkrm+HSvAnMiuECs8GX0wnVnmdH1fYXu+gM2cc VNRW46P15ohvRzz0WL4yK9aUHTUlY+aI0Tv2NBD8Z23XA/5UjEGRXfKxrvJnxhZn w1ajLJ2QRlkiSWqg0kosLBxFsqFRYY52KFaZ7d/YXOmJ7pI05g94s6VGxQ6qa1s4 Di8p2ZMdkBqhIA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peel X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id AFA2BE419A; Thu, 21 Feb 2019 01:29:41 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:13 +1030 Message-Id: <20190221062851.21958-15-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 14/52] libflash/ipmi-hiomap: Enforce message size for empty response X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The protocol defines the response to the associated messages as empty except for the command ID and sequence fields. If the BMC is returning extra data consider the message malformed. Cc: stable Signed-off-by: Andrew Jeffery --- libflash/ipmi-hiomap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index 7a36449a5d0b..56492fa87067 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -208,6 +208,12 @@ static void ipmi_hiomap_cmd_cb(struct ipmi_msg *msg) case HIOMAP_C_FLUSH: case HIOMAP_C_ACK: case HIOMAP_C_ERASE: + if (msg->resp_size != 2) { + prerror("%u: Unexpected response size: %u\n", msg->data[0], + msg->resp_size); + res->cc = IPMI_ERR_UNSPECIFIED; + break; + } break; default: prlog(PR_WARNING, "Unimplemented command handler: %u\n", From patchwork Thu Feb 21 06:28:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045792 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l772snwz9s6w for ; Thu, 21 Feb 2019 17:34:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="iNXC3FNX"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="mNS+SXqm"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l766V70zDqNP for ; Thu, 21 Feb 2019 17:34:10 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="iNXC3FNX"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="mNS+SXqm"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l234PkrzDqND for ; Thu, 21 Feb 2019 17:29:47 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6847B22220; Thu, 21 Feb 2019 01:29:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=7hUFhJKV3x0rw vu48d49XDg+GiYdpN6HnwIPhX5OKYQ=; b=iNXC3FNXs8UZPLH3n1i0iXn+OLwox xWUzMhrBZsnJDJ3OneRt6nB1BZcG8cWIaCsChexTzJ6Sv5rF3Ul8foHxfqhV1U1R Z5CzNYOQfFu6x/ocgTZ2sjhhwa/YlUt59tkzOKmCpA4UYj6AbWS+p4wG30gUYk3l HZ3amnHGT7NmMR1T08nomCkOCbbAwmCQn85oLKn4RCT1NypeH1au/GHcTmqUgJTM +if+2ZfR3guLdP2moc1fkcABCFUfS/UfkjZlgukC0A1NEf+DimWBvD9XYWuMxDLr 9sLWTj1Mdk8E6rf7KfXrVMbyio2FuLqK4rgo1zzNDDAC1/RJht4l/vs6w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=7hUFhJKV3x0rwvu48d49XDg+GiYdpN6HnwIPhX5OKYQ=; b=mNS+SXqm n0eiOMasr4H97UWTLddA0M395WaRZ0iD6QT+NQbd8GLg+Q0sadHxHxYbUgAVe+vW C8pntHLfxyw5X/DWXc8kqmR6hARDE9J1vuxgx8JvJOvxOjhezIXwNOPav5j35Lr9 4MskWnQVN6MA+L6AsV6N6mk23M4lC9s+5bYiYVoKHyALamnUPwPCo2rL3nfoZm+C 8m46OH0Xod8keMrxmQ45z9n1KWnJzrQBG9GKiJ7tw1y2QcM+oWLOFVCNpQ9PpO5K BzEdlUCSXRfVhXLnGVxn+FSNqSPLjgN3tx09keGA1XOIDf0gEQh6NiAwD/3pCJ/Q c/sspqlPpPVPSw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peel X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id C56EFE419A; Thu, 21 Feb 2019 01:29:43 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:14 +1030 Message-Id: <20190221062851.21958-16-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 15/52] test-ipmi-hiomap: Add protocol-persistent-error test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Cc: Vasant Hegde Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 4e1232f22ed0..08c9b32f816a 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -12,6 +13,9 @@ #include "../ipmi-hiomap.h" #include "../errors.h" +/* Stub for blocklevel debug macros */ +bool libflash_debug; + const struct bmc_sw_config bmc_sw_hiomap = { .ipmi_oem_hiomap_cmd = IPMI_CODE(0x3a, 0x5a), }; @@ -638,6 +642,34 @@ static void test_hiomap_protocol_reset_recovery(void) free(buf); } +static const struct scenario_event +scenario_hiomap_protocol_persistent_error[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { .type = scenario_sel, .s = { .bmc_state = HIOMAP_E_PROTOCOL_RESET } }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_persistent_error(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + char buf; + int rc; + + scenario_enter(scenario_hiomap_protocol_persistent_error); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + assert(ctx->bmc_state == HIOMAP_E_PROTOCOL_RESET); + rc = bl->read(bl, 0, &buf, sizeof(buf)); + assert(rc == FLASH_ERR_DEVICE_GONE); + rc = bl->read(bl, 0, &buf, sizeof(buf)); + assert(rc == FLASH_ERR_DEVICE_GONE); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -653,6 +685,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_event_daemon_lost_flash_control), TEST_CASE(test_hiomap_event_daemon_regained_flash_control_dirty), TEST_CASE(test_hiomap_protocol_reset_recovery), + TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045793 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l7L52zDz9s6w for ; Thu, 21 Feb 2019 17:34:22 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="YHceWOun"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="oh968UjN"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l7L3dHzzDqP4 for ; Thu, 21 Feb 2019 17:34:22 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="YHceWOun"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="oh968UjN"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l255fTXzDqMH for ; Thu, 21 Feb 2019 17:29:49 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 49DD5221D6; Thu, 21 Feb 2019 01:29:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=OCkt4Q/d8junH /Q0itzaVxcOmz9PVL2SUyYGv77VcLw=; b=YHceWOunH2kzp6TJtRJT48bhMzoac RZ6ef8us5iSvNYIGhUAse/dv8/C/ZWMEnrh0lLPmlH4xRpbg11RtKa7/50ZbUfSQ +OQSoxRnJuohFzWHdY6se81ep0Ygp/BNi9r3ntxbW9BXbxOuOSIThkw3HbF2WEXT OJ+VKvsbUDyBgN/lVSJnz3od4kajF+M+gPHYMdTWTJUcGP/y9RVyRF5Gz6c5Pp9w GBFRGIQUrp63nHr3M0crH8zGDAQPt+WDgbyKN9SxgNFneiDATWqMUybNMC2OSUWw fxWraxyOjqEubC8gHHkhUNnuSeb9jhwN4ug8R0gKARYiQZInBpD3LS87w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=OCkt4Q/d8junH/Q0itzaVxcOmz9PVL2SUyYGv77VcLw=; b=oh968UjN 9LzpQYWmpBNz8+xl9XMNzgcygV54Q7ovU6UtU8xGq1GY8RIyfDtm6fftuk/6XazA QXozgYo1hv0VJ5YhG9LV8Kn/qiMNE6YspD1uRsIzJeu9SCZfKk8npfO+2zvKR1mM lrjXgyS/xwAZCQVDzUg1a6W1uDBKPllVgIM+CmMA4FotgWU8Eqs91ctWqfmth3jU I5+k0M94mzDay/z/+gzGX8x+egY0sLfGtvyz8gdT2irDd7Dv+AkJ9psuIFBOBfqy k8nTkhAAQUk/m6DcMzV1OAhRVD73WNogK0EEmFahXXieZIOsUieJWLnH36rqaaHl f835y7exRi9IMQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peduvd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 8E716E419A; Thu, 21 Feb 2019 01:29:45 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:15 +1030 Message-Id: <20190221062851.21958-17-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 16/52] test-ipmi-hiomap: Add read-one-block test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 71 ++++++++++++++++++++++++++++++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 08c9b32f816a..f9c8ada88abe 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -207,13 +207,16 @@ int64_t lpc_write(enum OpalLPCAddressType addr_type __attribute__((unused)), } int64_t lpc_read(enum OpalLPCAddressType addr_type __attribute__((unused)), - uint32_t addr __attribute__((unused)), - uint32_t *data __attribute__((unused)), - uint32_t sz __attribute__((unused))) + uint32_t addr __attribute__((unused)), uint32_t *data, + uint32_t sz) { + memset(data, 0xaa, sz); + return 0; } +/* Commonly used messages */ + static const struct scenario_event hiomap_ack_call = { .type = scenario_cmd, .c = { @@ -276,6 +279,31 @@ static const struct scenario_event hiomap_get_flash_info_call = { }, }; +static const struct scenario_event +hiomap_create_read_window_qs0l1_rs0l1_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 4, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, +}; + static const struct scenario_event scenario_hiomap_init[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, { .type = scenario_event_p, .p = &hiomap_get_info_call, }, @@ -642,6 +670,42 @@ static void test_hiomap_protocol_reset_recovery(void) free(buf); } +static const struct scenario_event +scenario_hiomap_protocol_read_one_block[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_read_window_qs0l1_rs0l1_call, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_read_one_block(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + unsigned char *buf; + int i; + + scenario_enter(scenario_hiomap_protocol_read_one_block); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = malloc(len); + assert(buf); + assert(!bl->read(bl, 0, buf, len)); + assert(len > 64); + for (i = 0; i < 64; i++) + assert(buf[i] == 0xaa); + assert(!memcmp(buf, buf + 64, len - 64)); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -685,6 +749,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_event_daemon_lost_flash_control), TEST_CASE(test_hiomap_event_daemon_regained_flash_control_dirty), TEST_CASE(test_hiomap_protocol_reset_recovery), + TEST_CASE(test_hiomap_protocol_read_one_block), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045794 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l7b4lTBz9s6w for ; Thu, 21 Feb 2019 17:34:35 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="WZflJQ+o"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Z96RUl6B"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l7b3J3KzDqQC for ; Thu, 21 Feb 2019 17:34:35 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="WZflJQ+o"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Z96RUl6B"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l275KQ2zDqNG for ; Thu, 21 Feb 2019 17:29:51 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 76CFC221DC; Thu, 21 Feb 2019 01:29:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=6kZTUC0dCGi9U 9xYbElY5MsahpAmgojd/BIOtdcYq1g=; b=WZflJQ+o80Oh7RM0V/fExRzW/uUxd 4IhxFG3FphBnXMIVvZF4YF6OOfCuut59Jhj7tt6R7OBN8GuLEP6nlut2gR4pNG4N NlHPG2kU2WBHJ7K6DjicN0wVJKVHymdBBy7XUO0u/yHjmTaQTjjG9GAwH0vLnhzV eHhI6wot/pdaw3XhI6+cfwTsugrTkeegTZ0a3EGWXfPtdFWqpGc2nakomc5Fr7vz 08GoFK4BXTm4kZRspVOWkSFA5H8PABmZUnxt18S5qPNmxFb/CwMMLb57Z0Gl5zrc ShxggElGPhq17vRMoM/4CtQ3H+q5Njx5KRku42HMGmQ6ZZpX8EnYa99DQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=6kZTUC0dCGi9U9xYbElY5MsahpAmgojd/BIOtdcYq1g=; b=Z96RUl6B LR1dXjh1DKOVBqvSYtLt0ZfsOmL52eOPWRF2jCbUGpIe2BSEtAz76E/MfVbVgse6 SWd9AOND1zxkXo76pgcuRxYaopdg2FnQidyWshQcMpR/cuvnwe3tTMRdfzONo5zG TS6jBOrHkEDS0tCc9FxMhAvRggdrLYq3r89t82P8VrIxxoAZnWM04fhhppVuo41m zuhp7yLt0Ktar6snHgORX4pYMVUwhKzfZLaM/MQ1tjRfS6xNE9hm3Bh1NXD/KZBx Y/dY3LeiJDdeaWzOZlGOSxTCoHaHqAn0NCIFanrzqoA/d2KFX0cbyVYurZA83BXs BgQ3XP6SOUDeUQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peduvd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 8AB27E44A2; Thu, 21 Feb 2019 01:29:47 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:16 +1030 Message-Id: <20190221062851.21958-18-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 17/52] test-ipmi-hiomap: Add read-two-blocks test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 105 ++++++++++++++++++++++++++++--- 1 file changed, 98 insertions(+), 7 deletions(-) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index f9c8ada88abe..4df3641a0df6 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -215,6 +215,20 @@ int64_t lpc_read(enum OpalLPCAddressType addr_type __attribute__((unused)), return 0; } +static bool lpc_read_success(const uint8_t *buf, size_t len) +{ + if (len < 64) + while (len--) + if (*buf++ != 0xaa) + return false; + + for (int i = 0; i < 64; i++) + if (buf[i] != 0xaa) + return false; + + return !memcmp(buf, buf + 64, len - 64); +} + /* Commonly used messages */ static const struct scenario_event hiomap_ack_call = { @@ -304,6 +318,31 @@ hiomap_create_read_window_qs0l1_rs0l1_call = { }, }; +static const struct scenario_event +hiomap_create_read_window_qs0l2_rs0l1_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x02, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 4, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, +}; + static const struct scenario_event scenario_hiomap_init[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, { .type = scenario_event_p, .p = &hiomap_get_info_call, }, @@ -686,21 +725,72 @@ static void test_hiomap_protocol_read_one_block(void) { struct blocklevel_device *bl; struct ipmi_hiomap *ctx; + uint8_t *buf; size_t len; - unsigned char *buf; - int i; scenario_enter(scenario_hiomap_protocol_read_one_block); assert(!ipmi_hiomap_init(&bl)); ctx = container_of(bl, struct ipmi_hiomap, bl); len = 1 << ctx->block_size_shift; - buf = malloc(len); + buf = calloc(1, len); assert(buf); assert(!bl->read(bl, 0, buf, len)); - assert(len > 64); - for (i = 0; i < 64; i++) - assert(buf[i] == 0xaa); - assert(!memcmp(buf, buf + 64, len - 64)); + assert(lpc_read_success(buf, len)); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + +static const struct scenario_event +scenario_hiomap_protocol_read_two_blocks[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_read_window_qs0l2_rs0l1_call, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 5, + .args = { + [0] = 0x01, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 5, + .args = { + [0] = 0xfe, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x01, [5] = 0x00, + }, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_read_two_blocks(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + uint8_t *buf; + size_t len; + + scenario_enter(scenario_hiomap_protocol_read_two_blocks); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 2 * (1 << ctx->block_size_shift); + buf = calloc(1, len); + assert(buf); + assert(!bl->read(bl, 0, buf, len)); + assert(lpc_read_success(buf, len)); free(buf); ipmi_hiomap_exit(bl); scenario_exit(); @@ -750,6 +840,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_event_daemon_regained_flash_control_dirty), TEST_CASE(test_hiomap_protocol_reset_recovery), TEST_CASE(test_hiomap_protocol_read_one_block), + TEST_CASE(test_hiomap_protocol_read_two_blocks), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045795 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l7t0Mgcz9s6w for ; Thu, 21 Feb 2019 17:34:50 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="fqOjvnBo"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="v6Kw0Aww"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l7s6N81zDqR2 for ; Thu, 21 Feb 2019 17:34:49 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="fqOjvnBo"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="v6Kw0Aww"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2B19qzzDqNB for ; Thu, 21 Feb 2019 17:29:54 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id ED6AA2217B; Thu, 21 Feb 2019 01:29:51 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=bToPRUKWcqp1g NvrAanSKKcHOr9TUDvv2Dw6y5LBJOk=; b=fqOjvnBoEDcjxjLmbttbxb+3watTt +ioeD3NrhMzuRltcnFHzeIip38CKP/CbtW6ExysZTlj9TP6sZUOp7LX/ap4attBB dwxZ/6jUHUkghZyrwQWxkKbRZnB5LDjETH31wGoKj/buieKu9xSStVN5AdLIPaDk dFc8Nv30EGTxshoZkSZP/UTV6DWQyAqXlO7vdYbH0XU0fQvC4HgJQ4+RivW5f+lH V98e5emBHlaDcruSka06Pm7EJP2a1M3D3RhauGzRBuYybTQLtsBtXWGDSGyOPN7R /tYVCsIIeLH+0w04HkVt8ibmwChESMvhvJCy0d0bedihx8bNb7eIoas4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=bToPRUKWcqp1gNvrAanSKKcHOr9TUDvv2Dw6y5LBJOk=; b=v6Kw0Aww 1vN9mKhqdRj6eAQzJBeXiqU550564yYbDTM7H4Q8mRo7w9M1kFhZMgpMy2cD/g9i 7c4pxPYbEma8PFLn0XWyMtF4WM3zdluxViVsgaAeoCxQOP8dSrLrXMzkCucn0joJ 310TygkBr8eoSVnRxNlZ8Xm0prCoDhzSXh5WIR0gXOL2DbDAnTYBpmyH00MQEY0F m25d27UHtihg9Xw/JpwCFR8yWbzdUxS3yHhuGOu/jU4M79Kt59qCqg5yVGTTCxOG yV2oTQ01N2Jj1HV2GyWogjXyDpNY2XyMUxT/TBsZOZ1A7xZpJdPDwBkw0uTLbvuW nKYJCsbDBrSCmg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peduvd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id B9D1CE4210; Thu, 21 Feb 2019 01:29:49 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:17 +1030 Message-Id: <20190221062851.21958-19-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 18/52] test-ipmi-hiomap: Add event-before-read X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 4df3641a0df6..5eb5aeaeff58 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -796,6 +796,35 @@ static void test_hiomap_protocol_read_two_blocks(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_event_before_action[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_sel, + .s = { + .bmc_state = HIOMAP_E_DAEMON_READY | + HIOMAP_E_FLASH_LOST, + } + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_event_before_read(void) +{ + struct blocklevel_device *bl; + char buf; + int rc; + + scenario_enter(scenario_hiomap_protocol_event_before_action); + assert(!ipmi_hiomap_init(&bl)); + rc = bl->read(bl, 0, &buf, sizeof(buf)); + assert(rc == FLASH_ERR_AGAIN); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -841,6 +870,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_reset_recovery), TEST_CASE(test_hiomap_protocol_read_one_block), TEST_CASE(test_hiomap_protocol_read_two_blocks), + TEST_CASE(test_hiomap_protocol_event_before_read), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045796 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l866nzKz9s6w for ; Thu, 21 Feb 2019 17:35:02 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="XgpkJUQ2"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="bkB5wh2I"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l865YvYzDqS9 for ; Thu, 21 Feb 2019 17:35:02 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="XgpkJUQ2"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="bkB5wh2I"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2D34bYzDqNF for ; Thu, 21 Feb 2019 17:29:56 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F02A622206; Thu, 21 Feb 2019 01:29:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=OR/A4w6Hv+1d4 HJh/CEUJgtpp7sP+DjnRIX5mpoLUao=; b=XgpkJUQ2iqOqAjfF41KybfpmBuzS8 kHcoRo18/BkPNt6IgDR9bGeQajVe3/liOgZSRBovSw7dwmjB0qlULI8HR18MC6/U Aphot2mnSCtRrhU6Wkq/5c4cbclnaIVEJnDO9kZrP9EOI/8g8Id4NUWmWqgSKJnR OjhXOsPsgGUCfL51W5b/1IEzSvEQHCtxPOyt9/xi0zyOxLr29zRN/xFy/DOsxe6n dK1dV7nH59S5eq3vA3DKQil2LPindkuz1RrInNnEBkcmk4LEPBuDAyyW+/Yxqi0N CeuU36aCx9JR34rJhR3MOmKvX+Ez62zAmBbAF7iYp7wPCmGvd1pfowaZQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=OR/A4w6Hv+1d4HJh/CEUJgtpp7sP+DjnRIX5mpoLUao=; b=bkB5wh2I uRkxz8GapjGQBH03Er30zJ+ho/MlHgeOoLaVqdXpc6TLJLE9GvZzRG8NVWpB4ibe kxJNd664uHbQtD/v5c3J5pEqHj0CNezs3QqRsSXgndfHaQ69Ex+MbrM6jrCWT6eP 3CA0/tJSANr0b077i1N2rgVcvzCe/LiOPvqX+Cm0+GcQc4FoTkzhVGQybWEjMTzf SfoIZJF+QK46TYSQLE5UTG/h55DCq9S5+B71rdxj0+Tx18Eb2VGc7u+WkjOHjoJG di/TUIWWAfIDJstYfAUaXGBbe8NQmZVCmKFIKEqnL8ZDzKhWh/uiwN1yeR4E0yXt JRtM92FZHhzMeQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peduhe X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 27ED1E419A; Thu, 21 Feb 2019 01:29:51 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:18 +1030 Message-Id: <20190221062851.21958-20-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 19/52] test-ipmi-hiomap: Add event-during-read test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 5eb5aeaeff58..e8f89d9bc5ed 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -825,6 +825,46 @@ static void test_hiomap_protocol_event_before_read(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_event_during_read[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_read_window_qs0l1_rs0l1_call, + }, + { + .type = scenario_sel, + .s = { + .bmc_state = HIOMAP_E_DAEMON_READY | + HIOMAP_E_FLASH_LOST, + } + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_event_during_read(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + uint8_t *buf; + size_t len; + int rc; + + scenario_enter(scenario_hiomap_protocol_event_during_read); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + rc = bl->read(bl, 0, buf, len); + assert(rc == FLASH_ERR_AGAIN); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -871,6 +911,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_read_one_block), TEST_CASE(test_hiomap_protocol_read_two_blocks), TEST_CASE(test_hiomap_protocol_event_before_read), + TEST_CASE(test_hiomap_protocol_event_during_read), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045797 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l8N5qdrz9s6w for ; Thu, 21 Feb 2019 17:35:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="dNilJPbB"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="namXk993"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l8N4nnpzDqSs for ; Thu, 21 Feb 2019 17:35:16 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="dNilJPbB"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="namXk993"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2G55ljzDqNQ for ; Thu, 21 Feb 2019 17:29:58 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 84FE221F79; Thu, 21 Feb 2019 01:29:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=+xiReZ6pSNJP0 BOnnqfSlMujb3ZKAOv1d8t5gqgMSQQ=; b=dNilJPbBUqNbbAFumE1ZCkK30DWcr Ajk9vCRH6CURrkUAHm1cD2WbJ0vnuNbXSY9khk8DoP+32DrFmw3utvNfDd8UsmPD 7oHDrpmFcP28jlKKhEeblD7HUfGwbvc58nMpr0/Q/pwA/Z0Duv446Mw0nPhkZlwm /Tf3rgaqOBjHwQx2PHiVqA+W/Fd+hdUXMMRQzmktlPkaROY01IAj3IyZQZXNABU4 QRMEZvDwpjof6YDRtFeyPD2HASuFL9jXqJbmQB2V6KjZCZIUeYLF1BuGW4QflYbB 6ESWllWx8m0onZLtpdSSSyyl1DSs7N6T20a3EjsW7E8ePJ+cJiibe1mxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=+xiReZ6pSNJP0BOnnqfSlMujb3ZKAOv1d8t5gqgMSQQ=; b=namXk993 B9PMWP1E++NH8+DF7aqbuM3FFtiIqH2UvfG8wVS2mO61d1Qs1XhkYfZcQVJnR0SW 2CWTb1adFHJVQRLC64VA3KxfmWtN+3S8P2F7YVSzb4gXw8F0qhgmK9IwKLVvHObY 23Abvdju8+bnxARea3oc7MnzMdlVtxm+Th7dMg50RgPm6kU0OiYZNnFYy5C1kDwm dCXTZkXxikDbHYcmthlQM/qUnRT15KaXqD3FGX4EjsiCcoaptI0rodhWDtDO/qHc XiifHvFOLtbSAHLKZ86ri3se4lgukNMwqd1mpGPdk8pf1SFgYTK9oW8ob9j2Yfub xnTNVNJK6Y7ijQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peduhe X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 9157BE419A; Thu, 21 Feb 2019 01:29:54 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:19 +1030 Message-Id: <20190221062851.21958-21-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 20/52] test-ipmi-hiomap: Add write-one-block test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 92 ++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index e8f89d9bc5ed..f8305bfd57c4 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -343,6 +343,64 @@ hiomap_create_read_window_qs0l2_rs0l1_call = { }, }; +static const struct scenario_event +hiomap_create_write_window_qs0l1_rs0l1_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 4, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, +}; + +static const struct scenario_event hiomap_mark_dirty_qs0l1_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 5, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 5, + }, + }, +}; + +static const struct scenario_event hiomap_flush_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 6, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 6, + }, + }, +}; + static const struct scenario_event scenario_hiomap_init[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, { .type = scenario_event_p, .p = &hiomap_get_info_call, }, @@ -865,6 +923,39 @@ static void test_hiomap_protocol_event_during_read(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_write_one_block[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_mark_dirty_qs0l1_call, }, + { .type = scenario_event_p, .p = &hiomap_flush_call, }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_write_one_block(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + uint8_t *buf; + size_t len; + + scenario_enter(scenario_hiomap_protocol_write_one_block); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(!bl->write(bl, 0, buf, len)); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -912,6 +1003,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_read_two_blocks), TEST_CASE(test_hiomap_protocol_event_before_read), TEST_CASE(test_hiomap_protocol_event_during_read), + TEST_CASE(test_hiomap_protocol_write_one_block), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045798 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l8c5tpxz9s6w for ; Thu, 21 Feb 2019 17:35:28 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="kKNNk/iR"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="qYbxT74E"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l8c4nGWzDqV8 for ; Thu, 21 Feb 2019 17:35:28 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="kKNNk/iR"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="qYbxT74E"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2K1wyKzDqNJ for ; Thu, 21 Feb 2019 17:30:01 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7490722220; Thu, 21 Feb 2019 01:29:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:29:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=YAN8Yzhw0EF6m FwMXnmZ9r5OoArUpedY1RLINGqtm6I=; b=kKNNk/iRZtGCcbX813RjOp52dv4cX c7k8Fxwon/xckP8IZJKJ+k8qpP8k1oPd6lnsB5p93LDCgR8c2/oBuu9bTure213O DOijA/8jvZ6+yYnae8jyIA2cj7t7cBSUTQjacF5rZVsAYSHA5HUjMYMltF30gq7u YwoNrxHROBiLvTnGvBoOVxbZe0exnhzJpajj3yPBpwzuYatNc7er+UxAhBVezxPq iHh2oKVOrjXXTAvitP27JCmR6g5BKtQf0gPboSPmLEJK2kWRuheWU41RpPQrHsq2 2cyLbGtBV9CmuqsnvM6cYIU+27JbV7vGjcMGZqFA3KIVgK5eWXEP6zXtw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=YAN8Yzhw0EF6mFwMXnmZ9r5OoArUpedY1RLINGqtm6I=; b=qYbxT74E 0n4gcJ98p4sXsJX4pWcj1udJQl9tX/mgILSfsv7ShkPMzKlh2xREQIZT6O6Ldke4 rvolVJveCmO1PpbPRkZTNN8DsEkCQ0vwHAeU3upCHxvWPREnOt9cHRRDCvzYjrGe j0T16WgKCZQHVpOJ3qAKZ3PCRZBmD5slNsWFnfsgJrQI5DVUSfPrQG5uzZWZiv+V 2aOzjO18m2AmmNiaHA86FWoaBvdGK7AiLrhzGqxgM2Ea7v+itD7Ysxb7AP45guhc sfx50dY3ss/lMSsS3W3n+SSkkvqMG8u23HhsZMT0354TvmmziFlyBT2tlScLaokm QZMb/ia1At3RPA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peduje X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id B9499E419A; Thu, 21 Feb 2019 01:29:56 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:20 +1030 Message-Id: <20190221062851.21958-22-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 21/52] test-ipmi-hiomap: Add write-two-blocks test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 118 +++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index f8305bfd57c4..0902fbf2eda6 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -387,6 +387,31 @@ static const struct scenario_event hiomap_mark_dirty_qs0l1_call = { }, }; +static const struct scenario_event +hiomap_create_write_window_qs0l2_rs0l1_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x02, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 4, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, +}; + static const struct scenario_event hiomap_flush_call = { .type = scenario_cmd, .c = { @@ -401,6 +426,31 @@ static const struct scenario_event hiomap_flush_call = { }, }; +static const struct scenario_event +hiomap_create_write_window_qs1l1_rs1l1_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 7, + .args = { + [0] = 0x01, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 7, + .args = { + [0] = 0xfe, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x01, [5] = 0x00, + }, + }, + }, +}; + static const struct scenario_event scenario_hiomap_init[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, { .type = scenario_event_p, .p = &hiomap_get_info_call, }, @@ -956,6 +1006,73 @@ static void test_hiomap_protocol_write_one_block(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_write_two_blocks[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l2_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_mark_dirty_qs0l1_call, }, + { .type = scenario_event_p, .p = &hiomap_flush_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs1l1_rs1l1_call, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 8, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 8, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 9, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 9, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_write_two_blocks(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + uint8_t *buf; + size_t len; + + scenario_enter(scenario_hiomap_protocol_write_two_blocks); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 2 * (1 << ctx->block_size_shift); + buf = calloc(1, len); + assert(buf); + assert(!bl->write(bl, 0, buf, len)); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -1004,6 +1121,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_event_before_read), TEST_CASE(test_hiomap_protocol_event_during_read), TEST_CASE(test_hiomap_protocol_write_one_block), + TEST_CASE(test_hiomap_protocol_write_two_blocks), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045799 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l8v45SXz9s6w for ; Thu, 21 Feb 2019 17:35:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="rfBGFn2/"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="wkcbuVW9"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l8v2QgnzDqTY for ; Thu, 21 Feb 2019 17:35:43 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="rfBGFn2/"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="wkcbuVW9"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2L4KLFzDqNB for ; Thu, 21 Feb 2019 17:30:02 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5EA062217B; Thu, 21 Feb 2019 01:30:00 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=E5xMs954VngZ9 Tpgeu/OLnBmwCSTY9TASbrR2/tG7Z0=; b=rfBGFn2/Br9BBuTEJbQKZpmTuynog D6BjyogCpa6ZjF+B7By8DoqUybjAOYdSswsQRTf+hZJO1/rLBgO0MFaotJ2ddVUW BRN1Ka8gclbi7iFjKiHEjUvcQLRvICXoWnjAImN9Arg537RWT9S8oV6ZFajdpR22 hieFaKePAvd4sPDk9ccYxge9miVLd1BYQCeolzSD/wAyR1PRIydYOcg1fe6wmWAl Ca01P92QXSFHp0F/lwoIzzwzTE9bRrF5cAyudKovhuhpZBOI27ydNqHDeKcVgbev KUqu82zqqnIYdY/CeLwg+9dw+RMDNf/zEpcWLSlWNw7yH518Qtxft1BVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=E5xMs954VngZ9Tpgeu/OLnBmwCSTY9TASbrR2/tG7Z0=; b=wkcbuVW9 SxKnGtFExX4rSVLP/DPp9GcDK24Cmq7NAeBawsz1bIc4C+bQ45Ax+Sw9COv+qOub 13lpvM4R0Jld5sJ/wpLFREaOttO1sXHolq9eZll5Hm/7LNDaHbY/Na/QxpluOrI+ NpKxv2U8da/jXGIG5ovxj0whk78UZMdFkjyk7M4vYgnOhfT7vfgpF+rX9f8zGiYo WAIjpDtaGzpXmITanQIPOTMbKOK2C7ZgxQLsPVBivASbTbGAZzwOxxp8EEraFA/p +sgtibo7vPRhwW3XuGRwHFk8FP3kEqBVFNtAxTsHYIyJQhGWoxhstoN3J9SrVq9x oAaC8S2MmCNWOA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peduje X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 8B715E419A; Thu, 21 Feb 2019 01:29:58 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:21 +1030 Message-Id: <20190221062851.21958-23-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 22/52] test-ipmi-hiomap: Add event-before-write test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 0902fbf2eda6..34afef584be4 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1073,6 +1073,20 @@ static void test_hiomap_protocol_write_two_blocks(void) scenario_exit(); } +static void test_hiomap_protocol_event_before_write(void) +{ + struct blocklevel_device *bl; + char buf; + int rc; + + scenario_enter(scenario_hiomap_protocol_event_before_action); + assert(!ipmi_hiomap_init(&bl)); + rc = bl->write(bl, 0, &buf, sizeof(buf)); + assert(rc == FLASH_ERR_AGAIN); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -1122,6 +1136,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_event_during_read), TEST_CASE(test_hiomap_protocol_write_one_block), TEST_CASE(test_hiomap_protocol_write_two_blocks), + TEST_CASE(test_hiomap_protocol_event_before_write), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045800 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l996xYRz9sBF for ; Thu, 21 Feb 2019 17:35:57 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="f3iF/qcN"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="A7vceKd3"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l995y9VzDqWf for ; Thu, 21 Feb 2019 17:35:57 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="f3iF/qcN"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="A7vceKd3"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2P3DJLzDqNC for ; Thu, 21 Feb 2019 17:30:05 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 100F022220; Thu, 21 Feb 2019 01:30:03 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=bh30QYPP6Zbki 5cK1/PrR3cUx1ydMjoCkdHK48INpv4=; b=f3iF/qcNdLIFyUjXdCdhYRLr1LIXI Lm93xzlrMiVpbQDpJFnug4sG1yx5E7bahxXmHKIpgEr6ONLsSjzJV5jizPRe2lqs 19nXZ5CopPkyb4Hzby+CjiStHoot755ALvDL9Q9Gn+ZUR4ZSBtHA58ConEza/Wkp 9kySwKwHo2FP6/lyxcEfSCfO83fZgupDTcAB3HQwCO8XOmI6Bnjfql2c3SlI62xo rok48AiDbueL0/I2KGokqqOx4SyQ1MI/lJzs+VXXf6/Ed2WZ9pCofy82ewhkjsj/ IHaSCFMX+yhabwgpi0X9dGcmACUqhi3F3K7Bg/ktlJTVyuTj/HDnM8VKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=bh30QYPP6Zbki5cK1/PrR3cUx1ydMjoCkdHK48INpv4=; b=A7vceKd3 HG3JQPXDzGylZCWJxJP0p7UR15aLzuRSY6dEZKSPzmc/U58BG0xQ0nn+w1SVsF5P uuUiPGBuxNUtkf+NjJ6adK0cxeoTFz4+Wfzb31+eEwr5Tmco6YMwObcrGgeVLmkZ yB0477p0qleakuxKD+tEmKmJL3QHURLjKr+CumyKArUEiyiuwEjLEYkEX+OrV88j 1nsMWEcaZazAq2JAiyeQRsMTCdnAmXfavGjf1jYQW9qe4U81hODoffJFEtT/YISd FoNf0ZSw39SvMi2zA3yN1ZbuOiroV3ze06pLfMdlo+94M3GPU83IOQeQyguScjcy XGRTOR2jawsWDQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peduje X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id B1ED8E419A; Thu, 21 Feb 2019 01:30:00 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:22 +1030 Message-Id: <20190221062851.21958-24-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 23/52] test-ipmi-hiomap: Add event-during-write test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 34afef584be4..0576b0d087db 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1087,6 +1087,46 @@ static void test_hiomap_protocol_event_before_write(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_event_during_write[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { + .type = scenario_sel, + .s = { + .bmc_state = HIOMAP_E_DAEMON_READY | + HIOMAP_E_FLASH_LOST, + } + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_event_during_write(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + char *buf; + int rc; + + scenario_enter(scenario_hiomap_protocol_event_during_write); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + rc = bl->write(bl, 0, buf, len); + free(buf); + assert(rc == FLASH_ERR_AGAIN); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -1137,6 +1177,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_write_one_block), TEST_CASE(test_hiomap_protocol_write_two_blocks), TEST_CASE(test_hiomap_protocol_event_before_write), + TEST_CASE(test_hiomap_protocol_event_during_write), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045801 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l9W14dVz9s6w for ; Thu, 21 Feb 2019 17:36:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="ucYajiw2"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="RmTjsVQF"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l9V72xGzDqXZ for ; Thu, 21 Feb 2019 17:36:14 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="ucYajiw2"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="RmTjsVQF"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2R3GT1zDqNL for ; Thu, 21 Feb 2019 17:30:07 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1421C2217B; Thu, 21 Feb 2019 01:30:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=Z4QQVuy6Iv7gV H2c7D/v1x5SErTWssGN5ff7AKZ2QWE=; b=ucYajiw2exYZr1Bmf6GDUohRuoUPI L2TUXxtz0Nt5ikOCef4oNwbAUqCqhGrjBMRnCd3/0LZHjS2kCTU9FnoQG68Z/rSk Yw3S9P+sMD1eV+Im3MlrvihW5vuHvVcUbTM986Hi6McNUS5EUwYaz2LiaGkOjbkZ lcORbvKbpoXTnQVQezGqj1foh+y3pkHcM/HgaGtesoowyyoZU607iN+ULCORhRbU oVS4FygjqzzJB70hoNRcmMRYQ3jrnz2BfTi/3mJInJMSzk8XY0jJ2n738Uj07OFD u3k2bNmyHmoKpL5KQWzWKXDW/pv2cJeOSYhuDkNu1lulphCMe5KGgiQBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Z4QQVuy6Iv7gVH2c7D/v1x5SErTWssGN5ff7AKZ2QWE=; b=RmTjsVQF Pj4kIlQtM0z0nirAt7JsUULu2+1xqxz3LXpWRE8jE6UJHS7eAWI5aSOIdthhRuT6 KPWuczWSON6pFIU81UXx+xJuIAAeQaUDEIoApftUOS5e55+AWySqYqAuiZvA8lq6 RqeUQ537iDT2pCFpHYt+hkSJvsCcLo0NQ038dmlz1cnskk4bV6ajF3smBop5ZWnD jLnTa5x6V8whQm+nvfrU5NQxZgBEK/fh2AQrsZ2uKfypNq/yy/WqNjnJbU+9S4E1 FkdBDxTyFUuDeJNI5pwpcmJQjYP4qVGxv0PJQgNR7HjUwvyW5Nhp/i+l61t5W7xn 8yWfh264l/8t7g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvtd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id CA17CE4625; Thu, 21 Feb 2019 01:30:02 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:23 +1030 Message-Id: <20190221062851.21958-25-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 24/52] test-ipmi-hiomap: Add erase-one-block test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 54 ++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 0576b0d087db..242fc9bb2ed6 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -451,6 +451,24 @@ hiomap_create_write_window_qs1l1_rs1l1_call = { }, }; +static const struct scenario_event hiomap_erase_qs0l1_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 5, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 5, + }, + }, +}; + static const struct scenario_event scenario_hiomap_init[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, { .type = scenario_event_p, .p = &hiomap_get_info_call, }, @@ -1127,6 +1145,41 @@ static void test_hiomap_protocol_event_during_write(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_erase_one_block[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { + .type = scenario_event_p, + .p = &hiomap_erase_qs0l1_call, + }, + { + .type = scenario_event_p, + .p = &hiomap_flush_call, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_erase_one_block(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_protocol_erase_one_block); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + assert(!bl->erase(bl, 0, len)); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -1178,6 +1231,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_write_two_blocks), TEST_CASE(test_hiomap_protocol_event_before_write), TEST_CASE(test_hiomap_protocol_event_during_write), + TEST_CASE(test_hiomap_protocol_erase_one_block), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045802 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444l9q1smfz9s4Y for ; Thu, 21 Feb 2019 17:36:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="ncUmzJu7"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="qyi/beq+"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444l9q0vBSzDqQs for ; Thu, 21 Feb 2019 17:36:31 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="ncUmzJu7"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="qyi/beq+"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2V75WRzDqND for ; Thu, 21 Feb 2019 17:30:10 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6D95A221D6; Thu, 21 Feb 2019 01:30:08 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=GCbZpPvo/vFZ/ T/H9bmo/W36p8lQ6JJuQIoG8aR6cAs=; b=ncUmzJu7vKovfGAmQvIcKz41+k/j7 ZKpI0p1wOLtF30RUXNvKO4WPtIe8mPEh4jfANsd/gCoxc8YlxbOb6GJz7NxJQhS9 07BkRtfQnKAFSDcV6hBQxr/U3FjC3PMouKX884zPD9cMMqFZXQaIQq+kzQx68NsK O7wAB2EvEHHOgCjkuxo0K23Fr/i/ryhv3y+3z+qJPsfIUVLQV93+noxemUYEX7gw gmrXQpFi4y9hbvJgWG0bvSieQ80esyVDoM5LM21laikY7CzwEmbMtjsd1cevj9GD VNltF+/aeB5aNrJzVLcmTsCtuLWv3OmKwUNVedf1hMJOJWQ8ZWZsBfydQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=GCbZpPvo/vFZ/T/H9bmo/W36p8lQ6JJuQIoG8aR6cAs=; b=qyi/beq+ 6hH5HxFKNYJ3ELf7nmuNHQqi6X+uOrpy/8aZLxm9Wq0zwpqCDfaUboPdFDsCAPO4 2ZovS56H8bsAIkRLBEjBBau/oB2JS5IIJhc2sFJTC7AtjKaPdMuFD0/izlDcKyQ3 oN8JSygySRvEiQt72M+9+7FKCgytZLJ8/v8ab0p/Xn2z3DyO47JFAYP7WwQrkTxv Nf4+5nyNfmhRLAbUVcsuarBnRYm2usZvEbhf2k0WyCRDsJohTYaFgokx7dGS5qxk ZVervA58GOL6slZZl2R81+jkT7DElKPKkMuedaFKHhaid40BimsdHRKzHqbtbSh7 B/3r7iehox0+fA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvtd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 8F4A6E461F; Thu, 21 Feb 2019 01:30:04 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:24 +1030 Message-Id: <20190221062851.21958-26-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 25/52] test-ipmi-hiomap: Add erase-two-blocks test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 242fc9bb2ed6..99b2902b6446 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1165,6 +1165,69 @@ scenario_hiomap_protocol_erase_one_block[] = { SCENARIO_SENTINEL, }; +static const struct scenario_event +scenario_hiomap_protocol_erase_two_blocks[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l2_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_erase_qs0l1_call, }, + { .type = scenario_event_p, .p = &hiomap_flush_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs1l1_rs1l1_call, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 8, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 8, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 9, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 9, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_erase_two_blocks(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_protocol_erase_two_blocks); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 2 * (1 << ctx->block_size_shift); + assert(!bl->erase(bl, 0, len)); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static void test_hiomap_protocol_erase_one_block(void) { struct blocklevel_device *bl; @@ -1232,6 +1295,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_event_before_write), TEST_CASE(test_hiomap_protocol_event_during_write), TEST_CASE(test_hiomap_protocol_erase_one_block), + TEST_CASE(test_hiomap_protocol_erase_two_blocks), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045803 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lB50Phyz9s4Y for ; Thu, 21 Feb 2019 17:36:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="VpEY2C1n"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="LS72jUJ1"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lB468qtzDqSf for ; Thu, 21 Feb 2019 17:36:44 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="VpEY2C1n"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="LS72jUJ1"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2X5q8pzDqNQ for ; Thu, 21 Feb 2019 17:30:12 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8E23F222B3; Thu, 21 Feb 2019 01:30:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=uAa9usPjdTPUK 7LOoyLdAPMo+esNOeW+nDb7d8mQ9tk=; b=VpEY2C1nPgtz8YDICHniJY2/M1BuU d9W6S55asyRa8gdQl6EVDLaG3/8VzlvG58j+bErr6xNHtrI2AFuEpFXx+cRkoNsX QR/MkT9KcXm1citgWzpUt7vKFoHj4x7nXXbx/V60UaawUldiAjmS/J83biHNQjtN x26HQKPSbwgiQuAVkt14Bnhf3eXtQHS/UYLoxWz80/a9hS7uuaVlEo4RX4R6RvnX Gt6bH0xb2jEx7k79kk9KfK2Nvr9IPejC7JQxVng+akbt2tJAO/LZ5n19SbE9lQsV mZODRH21KwEA/Qypq2GWkYmNQIKJNstW9JNFqQ3E2i4NvjMdV+svLUOzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=uAa9usPjdTPUK7LOoyLdAPMo+esNOeW+nDb7d8mQ9tk=; b=LS72jUJ1 lBn/jNOnVMO+/GBmjG9NfJsBGsg5jsELZNkqTpwZL3zwQxYKdpBYar1T/tD8sOd0 6ZqNev28Zh7ZC3WQH4A5YuGURa5yrXMI4aClI8k7GOavYGwrkNxJMxEwytB3eNhx HpiFY1GSGpBW79Kz6LD+WMiqAAQsXU/LASZB2VHF8jlt4bbIPZZnzUPACapOcty1 AciZVuiZQ/I4B4rdyQp/rrHX/z3X/E6wKa13RGUwLYJqOsUEK/EWfOqXPHzMdHoU U7dY5A28FeVfp3h/bwRlCk8MXPZCWc9LwUbmMnG8EvFuB8y1LXt4UgYZmhfb82qo +MuDdhBbkla68w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvvd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id A2EB1E461F; Thu, 21 Feb 2019 01:30:08 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:25 +1030 Message-Id: <20190221062851.21958-27-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 26/52] test-ipmi-hiomap: Add event-before-erase test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 99b2902b6446..c00c30f6d4aa 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1243,6 +1243,23 @@ static void test_hiomap_protocol_erase_one_block(void) scenario_exit(); } +static void test_hiomap_protocol_event_before_erase(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + int rc; + + scenario_enter(scenario_hiomap_protocol_event_before_action); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + rc = bl->erase(bl, 0, len); + assert(rc == FLASH_ERR_AGAIN); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -1296,6 +1313,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_event_during_write), TEST_CASE(test_hiomap_protocol_erase_one_block), TEST_CASE(test_hiomap_protocol_erase_two_blocks), + TEST_CASE(test_hiomap_protocol_event_before_erase), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lBQ4FHNz9s4Y for ; Thu, 21 Feb 2019 17:37:02 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="Nc6CNYJJ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nZlhkHXx"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lBQ27rQzDqPb for ; Thu, 21 Feb 2019 17:37:02 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="Nc6CNYJJ"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nZlhkHXx"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2b20GCzDqNB for ; Thu, 21 Feb 2019 17:30:15 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7536922331; Thu, 21 Feb 2019 01:30:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=A5ZsKHiOfNI8y bm4QXWV+Buzd2kjzcR10E2oOBKjnmg=; b=Nc6CNYJJhWDgA6w3cXLU8FWKgTrog I5fHoRrD29man2qeuBy1Phf5gMBCfi2Bny+7KgKJdr+CLarF/YCBKNAUPhEXU9Aw /2DjVJomIcDd4ogZ0XqkIxv7xVyGmsFdzad67+m03iD4ueQxwDO3utoxhsG5uARE ceBFjHxdaPf+XZWwxN/Xq4eGHvmSWzgi60bjdjMzZyZ/LNga5zxFDTebP+2bTet/ 0dDPnjJ/Ojel6yxP9qXx+sWyOvRtiUe+87J3iAkXZcj58c+lIdIMUBZQUmijS3jg 8hwkpgkByf0gUCPHVKizPktFDu9m/DDfKtyU/fRMSq2G40OulHKOdPI/Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=A5ZsKHiOfNI8ybm4QXWV+Buzd2kjzcR10E2oOBKjnmg=; b=nZlhkHXx 3qGTl0A5QgNDpW2FTSbTAQJVBY6YOdPtoqobz8tIFHoyYAIBIa7eCfAUhw5BQe0r ghWXbaQUS6/ZQPxNmzatFvq+QcSCRrUFFxyrGi9hRunp5tOl4AVNZ0xpAvgCO4cR PTzg/vOgDkLFURo076gggqZvb0KIXFVn9wVTIiSAfOshSs5zd1LQWEz6z0qSHG4h pmh4rglay3nlIq9bBG0xlMzrSrapbr0hs30KnhM8xoe8xfdZuzdVuvL0fVjZkkgN 8gI+cg7A1t/nJSmKycsCP6YPDXYkM7cWc4v/r4WTc3kqU4Dk+Q40byM5jGwUu4zv 6Y+3hFJNrmXWBA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvvd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id D208AE461F; Thu, 21 Feb 2019 01:30:10 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:26 +1030 Message-Id: <20190221062851.21958-28-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 27/52] test-ipmi-hiomap: Add event-during-erase X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index c00c30f6d4aa..95bb35317636 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1260,6 +1260,42 @@ static void test_hiomap_protocol_event_before_erase(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_event_during_erase[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { + .type = scenario_sel, + .s = { + .bmc_state = HIOMAP_E_DAEMON_READY | + HIOMAP_E_FLASH_LOST, + } + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_event_during_erase(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + int rc; + + scenario_enter(scenario_hiomap_protocol_event_during_erase); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + rc = bl->erase(bl, 0, len); + assert(rc == FLASH_ERR_AGAIN); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -1314,6 +1350,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_erase_one_block), TEST_CASE(test_hiomap_protocol_erase_two_blocks), TEST_CASE(test_hiomap_protocol_event_before_erase), + TEST_CASE(test_hiomap_protocol_event_during_erase), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045805 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lBh3WvSz9sBF for ; Thu, 21 Feb 2019 17:37:16 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="dATFz2Lx"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="js60ORGk"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lBh2JMxzDqQr for ; Thu, 21 Feb 2019 17:37:16 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="dATFz2Lx"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="js60ORGk"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2c6QnJzDqNL for ; Thu, 21 Feb 2019 17:30:16 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A5F5522233; Thu, 21 Feb 2019 01:30:14 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=8xZSJ+qTFOgh6 6gJ62FY6PJrqa8O0mdnPasD45rs418=; b=dATFz2Lx6rCXlZ35xg53Zcm63xomI xw4DBlvsCc3MMDEM/nB9d5wH03pmxvv1exTbGS8hOstCNch05zRx9dEzrwUyOyI5 nMTCO1ssrYWHWbqxhjQZ9aSm4QFNryTaWgqRvnaJWeXbVcQPobF9TVblPR8zI7/2 jRedZgUVM6pkpSguKlfki3QeSMMg/3Cj932PCt2r7LucrA4wK2KhuZE33nDOv+FL Rnt0NW74cqAxY6inSSmh7oRDYOixuD9Mn0ithYzilmBe8SqLcp81MKKc+lGsUgfp FqHS/CUaTCLI+BxPexo4hAyd8dUwQyGm/X9fI9ftjMyhAa0oKaNu6WOkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=8xZSJ+qTFOgh66gJ62FY6PJrqa8O0mdnPasD45rs418=; b=js60ORGk zBHPJCiyS0sdVhyRuUCGpC6Lny6WWoXfzgkmf5Wrh0EIonhZsHQm86pTj25JIR1f saH6Dbkk3vHSm9NWeixLxY+u2Iqa3ZUKu3e9gDKrRiI4eByAr4yiOzys8zmSo8tW O5QiOHAvSGbBQHFqG2+i6vAqhaKdwpfmby61AaYelba0ROqQuNgCh8lQ5g+n1dHs jHfNoYUvJgCHtgqfkNG2kt2nwAWLnCM3Lec+vPNt+vnBxLVJOVaxU2feC+9nF2gG f2ZfCw2JzREMsaY7k18at4PDsCWylibHS+Wygq6CrvAIC8fJ2jIckekuH3SRai/G JLHDaAeHUv1ugA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvvd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id CE08CE419A; Thu, 21 Feb 2019 01:30:12 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:27 +1030 Message-Id: <20190221062851.21958-29-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 28/52] test-ipmi-hiomap: Add bad-sequence test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 95bb35317636..6e9d8e7f3007 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1296,6 +1296,36 @@ static void test_hiomap_protocol_event_during_erase(void) scenario_exit(); } +static const struct scenario_event scenario_hiomap_protocol_bad_sequence[] = { + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 1, + .args = { + [0] = HIOMAP_E_ACK_MASK, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 0, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_bad_sequence(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_protocol_bad_sequence); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -1351,6 +1381,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_erase_two_blocks), TEST_CASE(test_hiomap_protocol_event_before_erase), TEST_CASE(test_hiomap_protocol_event_during_erase), + TEST_CASE(test_hiomap_protocol_bad_sequence), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045806 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lBy6DN7z9s8m for ; Thu, 21 Feb 2019 17:37:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="jtrBOIAv"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="xuamBuvq"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lBy5BZszDqQZ for ; Thu, 21 Feb 2019 17:37:30 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="jtrBOIAv"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="xuamBuvq"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2g2vL2zDqNL for ; Thu, 21 Feb 2019 17:30:19 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0299221F79; Thu, 21 Feb 2019 01:30:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=daKkqVOlUT0IE qmRvcQSUphZbaJLR1hBR0GlVrxw4Mk=; b=jtrBOIAvzBqDFwgkb8sTpJ08I6mPX rsZxx0sR+Ggfdfhf0UW5gJIDpW8YTItYc+GqFWt00VZUkcQxAMycORC1CJtns55Q fEUdhf4cgbhLQMkP9cZAsKyHqIFLqZUYOwtR8HqlNbPYtZe8FljdRXkUEyOmBVLX OIrEToqDHRY16nAig30E4NRdv/IiA8BNLMUZgv1kCf65wJ6B+QCfNhVdSeRlJAuY O9rrBMkSyd7Hi9tI4XLMfHr5lMbeEO+rbNiiEt0tdX4J2J5Vl9ZKLcV7i5NRJhNz r+Q8qLm2o8w/1tgJZ9boCOE6/xNV+UUFZ7Z5XKTjHVzut90zeWWXYSppw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=daKkqVOlUT0IEqmRvcQSUphZbaJLR1hBR0GlVrxw4Mk=; b=xuamBuvq UjpRn0iI0eowcJx6IhaJCbfqlSKRNhIw/QbKHJB7tsihdV6m0OZKYSVBI7sh6VsQ IbPH6/OYj1/XYb5ujdcpcxXsdxiUYIfrftt+cXEUd5tALKe276jUqCsXWsIQjQTY NCl5ynFgo21s2SAnzTNT/XFX6lTHw8RlXt3bCQ6h3p3klNWhE52pPnhmLb/hHCkJ dIB20x5na1dm70dN54IjJBpzXv8SZ0Lg6W1G+3nGrTRV678cnew4I2Ujv6r9iZbC NAnQGHpJyl1LjafekwwUYy3V/fF2yM62hkr52UcfmwViZX0YHWVg0s0S2LORDqrP YAGaiWTJkv1Qiw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvhe X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id E3FBAE419A; Thu, 21 Feb 2019 01:30:14 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:28 +1030 Message-Id: <20190221062851.21958-30-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 29/52] test-ipmi-hiomap: Add action-error test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 6e9d8e7f3007..7e7689196307 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1326,6 +1326,35 @@ static void test_hiomap_protocol_bad_sequence(void) scenario_exit(); } +static const struct scenario_event scenario_hiomap_protocol_action_error[] = { + { + .type = scenario_cmd, + .c = { + /* Ack is legitimate, but we'll pretend it's invalid */ + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 1, + .args = { [0] = 0x3 }, + }, + .cc = IPMI_INVALID_COMMAND_ERR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 1, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_action_error(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_protocol_action_error); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -1382,6 +1411,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_event_before_erase), TEST_CASE(test_hiomap_protocol_event_during_erase), TEST_CASE(test_hiomap_protocol_bad_sequence), + TEST_CASE(test_hiomap_protocol_action_error), TEST_CASE(test_hiomap_protocol_persistent_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045807 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lCD4Zr0z9sBF for ; Thu, 21 Feb 2019 17:37:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="BX5AM4bs"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="24w76hHb"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lCD3NS3zDqQ0 for ; Thu, 21 Feb 2019 17:37:44 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="BX5AM4bs"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="24w76hHb"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2j33bzzDqMH for ; Thu, 21 Feb 2019 17:30:21 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2C9DD2217B; Thu, 21 Feb 2019 01:30:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=9RqGAe6heS6p8 H9l0ZCcEFUbEHaiI4gZXeMpM5lRIxw=; b=BX5AM4bs/RdUgOwuxSyjSXyOirJYU 7u39JPql0CIRy8I6IRh82R59f5hNEsgafrsZJMihrbsfYP7Il8z0BMKLA0n1JfeR ZNQfCnTEeiok02Y2bFtmu9SP8w3GZewycE5I/ZMKPrv5wyl6x8/0y4tueB9cGAp7 y1403GJfS/12V1WiwlIsNssMyofDgixqs+cc/RRRBS/yDxsFPx8aMEAv6/1vJ+FH z2H6NJLxCWXCtmthxw9LHTuuAj+4AtJBVjNZzX/Ar0LwBw8iZ38C896ONOBqbqqd NC+WBE6Y6xhDDXZKH4vqkJm973hQ0u70pmLpqYb+TsEurc/trdRdhHEVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=9RqGAe6heS6p8H9l0ZCcEFUbEHaiI4gZXeMpM5lRIxw=; b=24w76hHb JT2cJY1SZTH6LoT5bqNm6bwDzCMm/olXqj6PAylEt/GwhVUJEgrBjgbLVJHkBM+7 m59IJzHUTOfmPOF7uTH+nGltNcnBMn/kFMY+zG4YwxmZEFHlCH2Dfdf6H+l+035A w2gg6GEyf93zkFIn7HiL54paqkt2gZxsvle684EytNvDapSCIMmkg5ZzgkTKrQ3R WAcytWk9xIGF42Ban9L9Nl3ic9O2ohFoRZ3jUeYQ/wu/zX0X4fHtrBINlUNHcaOu kV6vOf19F4++0JeiO4X/NDUpD0yHlXgGQJsCdt8IgGKY4dX1/91Ke3t5JdJVLMjG uPSJ0VIXGjs2bA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvhe X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 386B5E419A; Thu, 21 Feb 2019 01:30:16 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:29 +1030 Message-Id: <20190221062851.21958-31-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 30/52] test-ipmi-hiomap: Add get-flash-info test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 46 ++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 7e7689196307..e29242f73b69 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1355,6 +1355,51 @@ static void test_hiomap_protocol_action_error(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_get_flash_info[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 4, + .args = { + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x20, + [2] = 0x01, [3] = 0x00, + }, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_get_flash_info(void) +{ + struct blocklevel_device *bl; + const char *name; + uint32_t granule; + uint64_t size; + + scenario_enter(scenario_hiomap_protocol_get_flash_info); + assert(!ipmi_hiomap_init(&bl)); + assert(!bl->get_info(bl, &name, &size, &granule)); + assert(!name); + assert(size == (32 * 1024 * 1024)); + assert(granule == (4 * 1024)); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_persistent_error[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -1413,6 +1458,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_bad_sequence), TEST_CASE(test_hiomap_protocol_action_error), TEST_CASE(test_hiomap_protocol_persistent_error), + TEST_CASE(test_hiomap_protocol_get_flash_info), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045808 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lCb0Hcyz9s4Y for ; Thu, 21 Feb 2019 17:38:03 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="rY2wrSLK"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="mbJBLJZ3"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lCZ6BG0zDqSV for ; Thu, 21 Feb 2019 17:38:02 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="rY2wrSLK"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="mbJBLJZ3"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2l6PfpzDqNH for ; Thu, 21 Feb 2019 17:30:23 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A5E3E222C1; Thu, 21 Feb 2019 01:30:21 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=TntujYwAr0jq9 ESLT6MlYqDvr2XfO9aqSQ2Guvzzruc=; b=rY2wrSLKk8C7r4FzhTwSP08+Bd0yO 5OjG2oClnOoVSByV164F8osDLXkozswc8Dk39qjk7tztQ5K6iMmcwE7ZzC3whsEl +NF6IbnuJLqxBUaoP8FaVCVOev9u/Nj/15d81qm6e19atzpaxE3+Zo2VT1DQd9NU SXKWf1VOhp5wQT+/0riNGGUiJTw/hWOzQhiajTAR8/i70HdpbPYn9HtegyQeoTG2 +JUB1QtEdMyUxItJVlzg9q2caiA5AqTtHQhwfwlyntVtToJOcwSJV5xjitrXTbXY 4tBx0ZDFXnx0/5I07pfmdEdLdFa1mNooCp17FWkvCgKKxRGKx+PVw8uCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=TntujYwAr0jq9ESLT6MlYqDvr2XfO9aqSQ2Guvzzruc=; b=mbJBLJZ3 8UUZa8hCr4UbMwyYAdAxJZ1nu1d08knt/SwivaosNa26AM+MWzb0OaZ8PomvfKFe ow7D9h/gQHEaDDkIopqIGyLAdIae9AU5laHajg7o26HJOE0mHD5uae2Zb7kC1ymI lAXuOANLFkmNfH0WiHZ4nXW5LluGWoPr+jOH7owJRUvzGhlUsb5cgGm/lh2O6s3o QfT7v8xlA35tXias2guskt6TRu7M6459MpGjmRkKEpOGDJLz4GiNHh0uzgfgas0/ 2xoq7EYagSRelA2HE+jKtlt8WdXDFLPBcbRl0F1gYvQkefqo5UddB1YAyBA1gezn RwG1MMBgPjYDrQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvhe X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 9B124E4625; Thu, 21 Feb 2019 01:30:19 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:30 +1030 Message-Id: <20190221062851.21958-32-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 31/52] test-ipmi-hiomap: Add get-info-error test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index e29242f73b69..4d050e804302 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1428,6 +1428,34 @@ static void test_hiomap_protocol_persistent_error(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_get_info_error[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 2, + .args = { + [0] = HIOMAP_V2, + }, + }, + .cc = IPMI_INVALID_COMMAND_ERR, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_get_info_error(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_get_info_error); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1459,6 +1487,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_action_error), TEST_CASE(test_hiomap_protocol_persistent_error), TEST_CASE(test_hiomap_protocol_get_flash_info), + TEST_CASE(test_hiomap_get_info_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lCs4LfPz9s8m for ; Thu, 21 Feb 2019 17:38:17 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="E0OgFHXl"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="r571ajzV"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lCs3G7rzDqT4 for ; Thu, 21 Feb 2019 17:38:17 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="E0OgFHXl"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="r571ajzV"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2q2ZWtzDqNb for ; Thu, 21 Feb 2019 17:30:25 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B20A821F79; Thu, 21 Feb 2019 01:30:23 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=hMsewc1XVbgFw jLgurI5ALiFEYqQ9uex+0zJ7qaTRfI=; b=E0OgFHXldScugCps1IKUDrYis3RBE B120uv4E9n/tSx+RPeHPmXo4lEnWZYSyOOoJY2ikS1jlV7eRf1GTUdnALYyo6PIH OAu1NZRUizmuL88+VEYb54HF38k04LO1jPYUr/pETklhXijZe2xkNQvIjScDvhGI CuLAE3Z1DTkPSOP/RORE3QSy9FbbhitMO1f87MQGFDI8qszHEYA0MNHlAtv3oE3d XdrAWb/IBlqnpOlBW8ErColNMjqPdRl8MyEnpAfTHTOIoY9RNvrRDpJ7HQvHSORi 6JSnuwuDKD6z4p3lW+3hfaQswNrHiQo66GPrjy+2iiwB/JqPn92Mg0QNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=hMsewc1XVbgFwjLgurI5ALiFEYqQ9uex+0zJ7qaTRfI=; b=r571ajzV 8HaawMJlhEx917yhPW9yWLr2PZB9yZPR+JRKhF/+o110xXitbsTKcq5FqpyV7xZ1 fCPWvGx3coCH03Gtl2ibOHXcAqgaO/tTfQokYNsWGhsOQ3rz8HUlNm1c4DJnSdXG M4PPx/EEAh84VsO/kZo6QFVo6G+q3H6PU5cB1BnkYDY2OiC0p+1QLLySqr62PNmx oyNqemp/9hdrsPm7mSgw3WqrC+27AovV/hnF6IJ9KA6yLAqWChaZo6HHXDVc33Vp nqutbbKAQvMr0hH8o5+RUiOxU0H0FhgQjsBKLZGpmMGQc8LR75xuFvr/jjuWH4Fd n9lnAf5rTxbqCQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvke X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id B8100E419A; Thu, 21 Feb 2019 01:30:21 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:31 +1030 Message-Id: <20190221062851.21958-33-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 32/52] test-ipmi-hiomap: Add get-flash-info-error test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 4d050e804302..0820a3100013 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1456,6 +1456,35 @@ static void test_hiomap_get_info_error(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_get_flash_info_error[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 3, + .args = { + [0] = HIOMAP_V2, + }, + }, + .cc = IPMI_INVALID_COMMAND_ERR, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_get_flash_info_error(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_get_flash_info_error); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1488,6 +1517,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_persistent_error), TEST_CASE(test_hiomap_protocol_get_flash_info), TEST_CASE(test_hiomap_get_info_error), + TEST_CASE(test_hiomap_get_flash_info_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045810 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lD621pHz9s4Y for ; Thu, 21 Feb 2019 17:38:30 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="fVUCDvlx"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CF3+uHXO"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lD615wGzDqTl for ; Thu, 21 Feb 2019 17:38:30 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="fVUCDvlx"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CF3+uHXO"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2s0hf6zDqNH for ; Thu, 21 Feb 2019 17:30:29 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id DD8CD22167; Thu, 21 Feb 2019 01:30:26 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=GjDbrR6ZyUay5 blERO0wxtH8dOfN8SVx2VfymvlAKaI=; b=fVUCDvlxmEJFHEY0fW8BRXiliEKMU sD43TD3V/IDZYnZRZYs566XjUERcTEo1o7MxQLoG75iwAsXO3KeUauBfOXCcNw4m Ayf6xfWNq4Q6tqH2QXUl3k05n1kXUTXlECRCDTrlp1crtIrdVuVtfqMQVU6inGes /WPY7Jd4D5YM/7xLAQEJskyY+/DeFXG1+096e9q1/jHborydA9M3My5Jviw9HSw7 Jk9od9wovJcxUHG60lHRBe7Nl4DgZdkDcnLwDyZjYT5m971RvGFOoKTaxRGViJtp v9G5jTiDTi7Ex5QRIKnr6tuIoXo9eYkDSi9Fg0aUqsGW3fRxXgTbUsQTQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=GjDbrR6ZyUay5blERO0wxtH8dOfN8SVx2VfymvlAKaI=; b=CF3+uHXO LFwEtXLZpj+lvF6NjE7B5xgWYw7qGfQ6SIfyFN6SgLueoeRcN0upu5JIZoKfhWp+ zjCf7ACQ1SfCN2bCyvMFrnbWX3YzthPU+iLC5Ag9gEg9o8aKWram5CGvdspwlpUg VeMONxAXMvP31td83o5Cs1P0ME6uDjYs76wTzxxh80DMX/MqfIdMnq33aRhhTaQl 8+4mSu9nVZfjlKeZWa9tMiejDDkGp8aIih7ugiNYwbAc2a5iQqNsC5CvzVyiediz M8hlh0weQLLyYDB6eBhGabOI5EVjqdxLUzvMRy+U6vbdclVuWO5katz9rzG719un OeXo1UqUOBTWsQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv pedvke X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id F1768E419A; Thu, 21 Feb 2019 01:30:23 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:32 +1030 Message-Id: <20190221062851.21958-34-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 33/52] test-ipmi-hiomap: Add create-read-window-error test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 0820a3100013..9512280b1871 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1485,6 +1485,47 @@ static void test_hiomap_get_flash_info_error(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_create_read_window_error[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_INVALID_COMMAND_ERR, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_create_read_window_error(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_create_read_window_error); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->read(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1518,6 +1559,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_get_flash_info), TEST_CASE(test_hiomap_get_info_error), TEST_CASE(test_hiomap_get_flash_info_error), + TEST_CASE(test_hiomap_create_read_window_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045811 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lDP0nwxz9s8m for ; Thu, 21 Feb 2019 17:38:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="h8iDXiva"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="RUuS4Tf6"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lDN6s1GzDqVQ for ; Thu, 21 Feb 2019 17:38:44 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="h8iDXiva"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="RUuS4Tf6"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2t6nW3zDqNV for ; Thu, 21 Feb 2019 17:30:30 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9771B21F79; Thu, 21 Feb 2019 01:30:28 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=7kZVviHtJ9Oh4 t6iGpfcE1fL/gn/y3kzUIrwVGaWgCk=; b=h8iDXiva/NzNBLSTlIypIXVZy54Eh l6aWFF6nB9ADTXOZrjt1LhI+Nh8kZkyGqoE50EevbrDqDQAQo5QEQDl5lT7vymU1 r54WcIDdq7bIwnSQQs6Tn3VIvd6VY3RQCmKPLiXA8DS1jL6DoNSPLwGu1e0jkpwM MDc26kD6m44dJUWmajPEIuLV/5mUMh3Q1DnkuHhN+DW2yycH9/7ykKm4GsADx1Bs KfW0ZPnIJJ6Q5i+hfQ1WmLYp7eJY4XCmg2cjSZKRaOVXiosLa1lEt0p10kDLhjP5 lW+BE2ZmTyQoPI1QU4vk3EtNaQ4sEiYw8htsFGj64L+TKsrvG4EONHJ2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=7kZVviHtJ9Oh4t6iGpfcE1fL/gn/y3kzUIrwVGaWgCk=; b=RUuS4Tf6 EP+3uWuDgnpToyQlIrosTRu91mmntdVVlDReDy02Esd5S9SeoKtTfvAj8ZsJTOkm woFF6bPyE4qUzr+b+v4zvrdBB/h0TaSSXZEhr7CpkbcfpybAm3G6knI+ZAOIueFN 0o7Crb94awzbDU6I3SrSlbcjm//u6ePbG8ihMB2PAArqA8DZsern6S3VxT+biZaX RfDu7SaJc8Y6ScY73MH++9nMKRDFPTmWfBDhrnJIo7MEloHfDL2YWndbEnV1xzJ7 GJoXXByMiUgI1KmZsSSj8evaKFeTHN35J+CvYE/XWcDB3d4A6dqQKjCK1ugVA+EC A8t5ns7XyNKPpw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peeftd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 8A167E4625; Thu, 21 Feb 2019 01:30:26 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:33 +1030 Message-Id: <20190221062851.21958-35-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 34/52] test-ipmi-hiomap: Add create-write-window-error test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 9512280b1871..04f8760f328f 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1526,6 +1526,47 @@ static void test_hiomap_create_read_window_error(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_create_write_window_error[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_INVALID_COMMAND_ERR, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_create_write_window_error(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_create_write_window_error); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->write(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1560,6 +1601,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_get_info_error), TEST_CASE(test_hiomap_get_flash_info_error), TEST_CASE(test_hiomap_create_read_window_error), + TEST_CASE(test_hiomap_create_write_window_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045813 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lDj6nzqz9sBF for ; Thu, 21 Feb 2019 17:39:01 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="K6mSYJOI"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="LnFQM4qA"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lDj5FghzDqNp for ; Thu, 21 Feb 2019 17:39:01 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="K6mSYJOI"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="LnFQM4qA"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2w512hzDqMH for ; Thu, 21 Feb 2019 17:30:32 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7B9D02218B; Thu, 21 Feb 2019 01:30:30 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=L6gEZFmqVRb63 dAnFoJF/qHn90H8QoO/X/EfobNWYZE=; b=K6mSYJOIYWR06d1bEi0YwIr0wcLQ3 rELo41202sXnJm9y6JQ28TNNU/8BNaPiHd75+oGYjNosfhDYBoMxqNN65+tyyy0L 3/Q14uTrJSKJ3z28zUDz6jGGdjqhBVoaeOLDkBzHAsoAaokE0NlSyB3fCn6NfSQU tHDpGJYZfIo5XlgrPA+KRFziL1KMeo6xPcsYL31ZH03kjP85sm8PnxATtV7EhPQI 4VS4889VhoFBqb19GKdT/jDEdQVMTG0P9ll5tvmDfct284sdGRPpwGkrv1oByh9/ ZZI2119zBoBWO7L4fKc2kgi1Z1OSYIDGGh8l6Q2vDN4z9jAfqp/sXQfQA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=L6gEZFmqVRb63dAnFoJF/qHn90H8QoO/X/EfobNWYZE=; b=LnFQM4qA Jpi7Vl0AvehCToiTy+l6O6CMiryfVxAnwd62RhoAaPyhMLKGHnxoPHxxY8ZE36de xJph7oAwvnFVsJgi8ATctINHBcvCKGyNfntzv+g+BPEQHpUFdFCPyiNvJys0Evck aPwjW47LVz2MbwGPYesDNuiqTL58k4e3o1QQJINIpzHZBe6/Fm3yZq3GJVhHllOJ RXONswrmVASWbCXMTk2F4S7ltRmoljJ9mU4mh8sipeFWui7MrgsTJumzDBkBd1x1 bWLa2bDU0rsjYz3nGLZelh35OG15gIRbxbVsf1ZP8eygoa2InDJX9MfuAwZBv8jE QXTaJajoJjHfjg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peeftd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id B0920E4597; Thu, 21 Feb 2019 01:30:28 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:34 +1030 Message-Id: <20190221062851.21958-36-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 35/52] test-ipmi-hiomap: Add mark-dirty-error test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 04f8760f328f..5613486aad65 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1567,6 +1567,50 @@ static void test_hiomap_create_write_window_error(void) scenario_exit(); } +static const struct scenario_event scenario_hiomap_mark_dirty_error[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 5, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_INVALID_COMMAND_ERR, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_mark_dirty_error(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_mark_dirty_error); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->write(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1602,6 +1646,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_get_flash_info_error), TEST_CASE(test_hiomap_create_read_window_error), TEST_CASE(test_hiomap_create_write_window_error), + TEST_CASE(test_hiomap_mark_dirty_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045814 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lF92vGKz9s4Y for ; Thu, 21 Feb 2019 17:39:25 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="BE/Ll5Xq"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="eGXsh423"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lF91n4pzDqVw for ; Thu, 21 Feb 2019 17:39:25 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="BE/Ll5Xq"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="eGXsh423"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l2z2j8YzDqNH for ; Thu, 21 Feb 2019 17:30:35 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E61B022167; Thu, 21 Feb 2019 01:30:32 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=6yZ3Sp+xUHAPE s55QJ7WjTiMq1bd02lvE0TMOfeWE1M=; b=BE/Ll5XqGWDvIi1Qi/PULJkuy5aey 61FLgdMMw+HHWcOEWUlXknTf7OoYUKlGDqezb6Q/NMs3NW/zI6l4xd/AH8RmLOcq i/kZEjCi4mSkLRgE2EuUjE+LdMLjCLUA2s9jGKKudVwrW1RUGHAgbQles8C1U/6g zF94nmFYI4BQhL3TegVuPTYtzKlLWxp5PtG9xInMQNEk8Ah5Y0AH6b8I9uVpG0QK YTecGdJNJ7zSINkaJFyY2KHpUjvCd1hbYouGYgEIQMWDtGKdy0FzfNdW+3lfgsl2 7bzpstt7T2gAHPw8QZhGajiBOjRPHlbDqQOpwmtInGlytY2y0wj704siQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=6yZ3Sp+xUHAPEs55QJ7WjTiMq1bd02lvE0TMOfeWE1M=; b=eGXsh423 8q+/FUJ41zyO1ZD8FR/8WrT7OWX+TYgZU6h0KKSA8K+F7Yj1jDjI6HWO9izWAPIp tH0Iz+OIix+QeDCPoWvFVUOZ+iNEChadHNj7aL3U4dL5SiAgZB34D4YJehLUk71L tzCQbxl7HMG1Xx5UsizJelMDS7sB4LRiOMK0gerTBXp5Mp6vstiRfKtAUEuX46a+ hwkVkhVM0l9iEdy+ROcP72mtREN6pP9cdG/LgfzXft5cHsTh8EMSv0bt2VIFAWjX S4NeUwOz360Tp9tEGWKUVRHrSj1fRtdWILyS2famQyQvMuWorkO4Pgm7lZnSBnHt yRncfjL3zVbelg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peeftd X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id AC115E45E2; Thu, 21 Feb 2019 01:30:30 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:35 +1030 Message-Id: <20190221062851.21958-37-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 36/52] test-ipmi-hiomap: Add flush-error test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 5613486aad65..7c1a3c3b7140 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1611,6 +1611,47 @@ static void test_hiomap_mark_dirty_error(void) scenario_exit(); } +static const struct scenario_event scenario_hiomap_flush_error[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_mark_dirty_qs0l1_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 6, + }, + .cc = IPMI_INVALID_COMMAND_ERR, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_flush_error(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_flush_error); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->write(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1647,6 +1688,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_create_read_window_error), TEST_CASE(test_hiomap_create_write_window_error), TEST_CASE(test_hiomap_mark_dirty_error), + TEST_CASE(test_hiomap_flush_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lFQ6DPDz9s4Y for ; Thu, 21 Feb 2019 17:39:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="F2M+w1HX"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="UGFXlyKe"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lFQ5GmWzDq5j for ; Thu, 21 Feb 2019 17:39:38 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="F2M+w1HX"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="UGFXlyKe"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l313mmKzDqNC for ; Thu, 21 Feb 2019 17:30:37 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4744C221DC; Thu, 21 Feb 2019 01:30:35 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=gZU7B9c2C+Kox L4TcYrGnDAGP/17BI19JDbsGEljyc4=; b=F2M+w1HXthsJa/o1GLR9DWFwbkFfL VLYiJ01jj4lCmZkxcooI0/aA0yUOb5l80Pnuu0vMfehfynyxYyfLA+gcXCG4Jsuq 9OUp+9MJNWWMdeqa3NCZEb58QUSLWcvtihDMc13rtZVVcUfu7k+8UodxRAn3vCe4 XMweDTfdauV74WCbcFWf5nbNxxtWN5tfWLs+KmAYmgra9qqu2z8cuR+f57kfCDjc XMQ9UNbCduccPp9sCx0OivzfaipdU9beIQi9hdJKl0NyZc6tEiA4VRXbs7tLXTbb Hcvhc7DjT14tWAD/axPPLo49TLNEBEWvzns/CvQ6SCl1S98kFseklM8KA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=gZU7B9c2C+KoxL4TcYrGnDAGP/17BI19JDbsGEljyc4=; b=UGFXlyKe NC857MS6Yg0JxI89TOXnjkK1CrsFnr1r9Y2VqxMJX7ddd4z2MQN1EShUIL99iuKB Vi4BtKphESr3wHo2gppIRMOyYcGoyfxROcr+hNxk/lTEem4RTjnFVyQ7vtvTwFuF FeNg/lxVy2CHQfSEFdFrScnh4IhoZ9mnxArcRID6h+HLOrTcYT4/9F8Pf3YoDZNM cRoWz0kOMgPNFQMe7VMd/6D1JoH5uRG9qaNt6W46LhBT9FSoPpZ5YQd5lEGJ1fqi D1qPeIOtHJhnKJrBjsyHBG1sR8LT4wRcCfaztWjluHL3QLJL6N+uMyJSe8lOmg8w Tc7taGF2WphXrg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peeffe X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 34E2DE45E2; Thu, 21 Feb 2019 01:30:32 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:36 +1030 Message-Id: <20190221062851.21958-38-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 37/52] test-ipmi-hiomap: Add ack-error test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 7c1a3c3b7140..485da9f3089a 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1652,6 +1652,12 @@ static void test_hiomap_flush_error(void) scenario_exit(); } +static void test_hiomap_ack_error(void) +{ + /* Same thing at the moment */ + test_hiomap_protocol_action_error(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1689,6 +1695,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_create_write_window_error), TEST_CASE(test_hiomap_mark_dirty_error), TEST_CASE(test_hiomap_flush_error), + TEST_CASE(test_hiomap_ack_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045816 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lFk4vV2z9s8m for ; Thu, 21 Feb 2019 17:39:54 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="lWAlVVS2"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="3kU5EK0p"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lFk3YsWzDqQb for ; Thu, 21 Feb 2019 17:39:54 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="lWAlVVS2"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="3kU5EK0p"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l332sd9zDqNB for ; Thu, 21 Feb 2019 17:30:39 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 32D8D22167; Thu, 21 Feb 2019 01:30:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=odekSvZkoYN1s tB1cSUO4rdCE7jxwa9nXO3vsiSgurs=; b=lWAlVVS2QMUDlLsFEBbOaYUB3fIre NcyJAumVtaf8/cXRnuyctXxRcESnKOnxW2SKHalm1GylYSyLaO3Hdru/rDPMI/na 6hU0T/BeAYdVRBD4fwtuul+OQiAI1Qs9tV/8Fco3mVAE/W6PxvC8RGc6Q2q0lTyc es5VpzQVff8mgYiAWTHtVGn/uxdMfx6vSmMG7IYnx3CVm8M/0iFvOuEPi9NPOiBr v+y4yqN0WpnKznMh7pD0BU8X2SzGaksaUwh3sP4vopZDGsw9cDDOb2J1vZjriJhS m7qQodtsPzoT7EM9flJiOWKKKVU8cfXLUVgeJ8WrFz9oUhKfK0MflFlUg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=odekSvZkoYN1stB1cSUO4rdCE7jxwa9nXO3vsiSgurs=; b=3kU5EK0p PJb0Gh/BmkI6+PCT8PEvzQBtK/c9IY44+mGNRi/oHZUKEenucrnXD6gJTBJ8pTPo Zj1FH41FATemyjiw/SQRp76QjnujqEEW75wffK4eI9UL06ejRz9u2DUUR+Uc0YFG I+DOJw5AKUyW9zAYiHKX8tg/wBms7zmeDoLtaZTIWJchI7Uhmb6vLx9F8boOHXP0 1oIZ+sXPgFVialXYl4AA5BY7/EtZJ8B/YUu+QTE+t56nvzJYMDFhyGz/Qf14/q9b vQ/+wJT3SaAij01Glqp5LKrsb6o77eRXcSUmaFsUSmpcS3oIZRwBYxsZLx0cH/Dm Uif7PxSY47lOCA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peeffe X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 861D5E419A; Thu, 21 Feb 2019 01:30:35 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:37 +1030 Message-Id: <20190221062851.21958-39-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 38/52] test-ipmi-hiomap: Add erase-error test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 485da9f3089a..8fbee1f27a49 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1658,6 +1658,46 @@ static void test_hiomap_ack_error(void) test_hiomap_protocol_action_error(); } +static const struct scenario_event scenario_hiomap_erase_error[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 5, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_INVALID_COMMAND_ERR, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_erase_error(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_erase_error); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + assert(bl->erase(bl, 0, len) > 0); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1696,6 +1736,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_mark_dirty_error), TEST_CASE(test_hiomap_flush_error), TEST_CASE(test_hiomap_ack_error), + TEST_CASE(test_hiomap_erase_error), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045817 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lG255Bxz9s4Y for ; Thu, 21 Feb 2019 17:40:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="lIjfTMjd"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="JSxAVeur"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lG23636zDqPv for ; Thu, 21 Feb 2019 17:40:10 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="lIjfTMjd"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="JSxAVeur"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l354s3VzDqNJ for ; Thu, 21 Feb 2019 17:30:41 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 779222217B; Thu, 21 Feb 2019 01:30:39 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=Lm/7jK+YwoPNn PPsTjIBa6a0mm/CQiFQKPv8G3QSZC8=; b=lIjfTMjdSwj8FAXJNi3Ua2YG72wr6 I29zGmdIA/JMLKKPXLTjpGbJ+Mc6ANcP78qRM4/UDvZ7i7EyKF6mzFFI3ALzMvih 6BQk4/+H44hc9PMbqtce1Ahn1R0xdTB8qFqOgvZOaMYScpgxs/iN0mxGvKKF2Ug2 wQVoQ725vjn3+k1eXaGA1sQ8EfI/wWVRWgv0Yd0xYcT3cIC4hAAIgWBKyY5ubKaC 4nXtqaGyd0jR9//1gz9h3WTzZMSezo4FJEZxdNsa84wp4/mKWFCM1v7kx+51NcKh FtjKdcMJtPy0pOCSfuY1xiE6PIAOASXBSjQ86RlOl+GfKa38MzqCzcSew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Lm/7jK+YwoPNnPPsTjIBa6a0mm/CQiFQKPv8G3QSZC8=; b=JSxAVeur Pn1IypGoFZstRyZLolXQx5CzDfYUC+NyT9uoaMvH5MuhlMeQuAJuQe527qH0k+y1 CgY4q0tASl2t0ca6FbCp+SUUuWuGHk4QKR7sevDqdRTKeBIh7r9+UYXgqDq3VFy1 +ASqzGI//pSE6PCgYS0ifNDO0rNUVGfGDaas+xwbnaYb9FUXd7jPFJN/xU95Biu3 vNErtVevVfbvatIwEyR+BQ0zm+Q3+YlHzCcqOFKJEwt/DNYIGKQ7Jc8wuyMXxFC2 dL7CzMoQI5pR34kkqXPDdq2bh7dWaMe7Q+XCNv+uXH1VJwYOTf9j9dQIkoAQfPQM kBi6hfJzn/Ivww== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peeffe X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 76D3BE419A; Thu, 21 Feb 2019 01:30:37 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:38 +1030 Message-Id: <20190221062851.21958-40-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 39/52] test-ipmi-hiomap: Add ack-malformed tests X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 8fbee1f27a49..05e3ecf3c29f 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -43,6 +43,7 @@ struct scenario_cmd { struct scenario_cmd_data req; struct scenario_cmd_data resp; uint8_t cc; + size_t resp_size; }; struct scenario_sel { @@ -177,6 +178,9 @@ void ipmi_queue_msg_sync(struct ipmi_msg *msg) msg->cc = cmd->cc; memcpy(msg->data, &cmd->resp, msg->resp_size); + if (cmd->resp_size) + msg->resp_size = cmd->resp_size; + msg->complete(msg); ctx->cursor++; @@ -1698,6 +1702,60 @@ static void test_hiomap_erase_error(void) scenario_exit(); } +static const struct scenario_event scenario_hiomap_ack_malformed_small[] = { + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 1, + .args = { [0] = 0x3 }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 1 + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_ack_malformed_small(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_ack_malformed_small); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + +static const struct scenario_event scenario_hiomap_ack_malformed_large[] = { + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 1, + .args = { [0] = 0x3 }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 3, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 1, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_ack_malformed_large(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_ack_malformed_large); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1737,6 +1795,8 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_flush_error), TEST_CASE(test_hiomap_ack_error), TEST_CASE(test_hiomap_erase_error), + TEST_CASE(test_hiomap_ack_malformed_small), + TEST_CASE(test_hiomap_ack_malformed_large), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045818 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lGJ0bSnz9s4Y for ; Thu, 21 Feb 2019 17:40:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="uEpWNhQC"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Rgi8zqKT"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lGH6YNHzDqQc for ; Thu, 21 Feb 2019 17:40:23 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="uEpWNhQC"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Rgi8zqKT"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l376frNzDqNP for ; Thu, 21 Feb 2019 17:30:43 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 802EE22250; Thu, 21 Feb 2019 01:30:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=YL93rbdzsQazI ibsDI04/D+vU6icG68yFGy8VEwyEKQ=; b=uEpWNhQCHsR5XkvLt9NAom6LGPfkx LxtaMgvk0IwuDsnuQQ9Pq6J4pUN+SEhMeebCDEm32ZN4r3vfFWvlB1bq3pxKevpj rEofirRsLQIDJrabG7uDzCajsPZRfaTz7i81M0UYkKwBrYedNmYYzNDBSJl3/juI k4Uoi0yx6F+jSIEsPzfpHq1zNTtfYxyMhHIQJFlqNClgR5Pf/4zSNrsrLLEMeiTL 6ixqgxtlcXWHUmU5OkWfxYaT9eVlH5JIYxroaub9Jba+tOVRFvFvbpTfr8O5rghg ll3SWx4qFDuoMvmAzKOfg5p/ADHDowItLVB3u8fgfXHR1OhROK8yXrICg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=YL93rbdzsQazIibsDI04/D+vU6icG68yFGy8VEwyEKQ=; b=Rgi8zqKT JB+xazRQVhm9YJ/Uv5R/cIURUG5Mt6hzwZ1LlVqi6PecyHD9AK47WtmcHTE0tZbE Z7XRVmYruA7w4Z3No4zsHSjkAGUyBoK0YDDQ+KwovgI9p+U44sZ0qkAMiHyPToUd EmDE+ghl/bkWB3bhz1Y9GltDKIA3WTT1DR63LxsqNvqyQ4o3r7oYBVsZ0nHgVkyk jAFWekIobyLMpUO7MMRKFcG80CZPS8527VXjIF420LJS2vDY3eD/WiQ2Mv2DHmYQ N76UsM/rT/R9T8ZlVJ7gY220fLbSZuRJcJYbUjgIroZeRf4pQImKQIs9nSanb0z/ M277i0ZiCIRtAA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peefie X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id A7E89E419A; Thu, 21 Feb 2019 01:30:39 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:39 +1030 Message-Id: <20190221062851.21958-41-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 40/52] test-ipmi-hiomap: Add get-info-malformed tests X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 05e3ecf3c29f..b51803602a0d 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1756,6 +1756,68 @@ static void test_hiomap_ack_malformed_large(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_get_info_malformed_small[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 2, + .args = { [0] = 0x2 }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 7, + .resp = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 2, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_get_info_malformed_small(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_get_info_malformed_small); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + +static const struct scenario_event +scenario_hiomap_get_info_malformed_large[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 2, + .args = { [0] = 0x2 }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 9, + .resp = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 2, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_get_info_malformed_large(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_get_info_malformed_large); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1797,6 +1859,8 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_erase_error), TEST_CASE(test_hiomap_ack_malformed_small), TEST_CASE(test_hiomap_ack_malformed_large), + TEST_CASE(test_hiomap_get_info_malformed_small), + TEST_CASE(test_hiomap_get_info_malformed_large), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045819 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lGf4zc3z9s4Y for ; Thu, 21 Feb 2019 17:40:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="R/YSHqnM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="8XCLpYwa"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lGf2nFLzDqGY for ; Thu, 21 Feb 2019 17:40:41 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="R/YSHqnM"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="8XCLpYwa"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3B0Kx1zDq5j for ; Thu, 21 Feb 2019 17:30:46 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9A09221F79; Thu, 21 Feb 2019 01:30:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=1u1BL3cj1JjpF zS68Qw7VOs6EjOzBEkSDdamAr6jmRI=; b=R/YSHqnMHVdK6u7YHecYKnXG8WN+7 RpelpVZmzcqi7N6a76MFHGw+Frfn3Lso+SEguE/6UVs9EqtkOBeQskMA/fTywQEV soTmJhKNkPSvne/vVv5SR8BdXeQQpEn3FtBsk+dX+3Digz9BjavLefT2HBkClH88 2CKn/o7rxuCPoIwqAYB59rwgn8Fqye2rGg/4q0QSp0LiYzw49THjOIDmnvrA9wqc tSNlq0E8T5JWLZ8M+u8fGpEAzZfSYrUJKQpEVT795Hmjld9enUesTCjY/94lAPNW 3aIW2xFM6hxGGHYgvaocuOA7Kk1HAwqw31ivKZVWhRnqwCT7Z7rhkVJzw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=1u1BL3cj1JjpFzS68Qw7VOs6EjOzBEkSDdamAr6jmRI=; b=8XCLpYwa FoUM6OUY5hfJmrVQhmCaKw1H1WNKM+cgycEl02bXI1ohjpTW8SeAJOM3sibBrfCR Oo/WcRV6UOHnMVY0sJ/Wi72gPlgr4rxRYqwWzmWiK5gYv6jkJxFJ+K8jBig/BUvY tju39L+VB6ArSdUB7hOxZ+uCRyN1agijXdRUsjHIgZQdiPLnGqAO2Drzj9zbtEvx kMhvt1dX8ZXavpz+GokbEGNN6Bk/ivvCantEQsccjQJHZRvi3yJ1yjoFpYJxWmZe 34nu2UK7xCV4Y5s4Ry/fpuEjsEM6YlmbrTqu92kg0D2Erm2Jas7x4UcvApNpNgmu z7sAqD19gS7RgA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peefie X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id D70F7E419A; Thu, 21 Feb 2019 01:30:41 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:40 +1030 Message-Id: <20190221062851.21958-42-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 41/52] test-ipmi-hiomap: Add get-flash-info-malformed tests X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index b51803602a0d..016ec1f7519a 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1818,6 +1818,68 @@ static void test_hiomap_get_info_malformed_large(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_get_flash_info_malformed_small[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 3, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 5, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 3, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_get_flash_info_malformed_small(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_get_flash_info_malformed_small); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + +static const struct scenario_event +scenario_hiomap_get_flash_info_malformed_large[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 3, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 7, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 3, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_get_flash_info_malformed_large(void) +{ + struct blocklevel_device *bl; + + scenario_enter(scenario_hiomap_get_flash_info_malformed_large); + assert(ipmi_hiomap_init(&bl) > 0); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1861,6 +1923,8 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_ack_malformed_large), TEST_CASE(test_hiomap_get_info_malformed_small), TEST_CASE(test_hiomap_get_info_malformed_large), + TEST_CASE(test_hiomap_get_flash_info_malformed_small), + TEST_CASE(test_hiomap_get_flash_info_malformed_large), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045820 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lGv3dr9z9s8m for ; Thu, 21 Feb 2019 17:40:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="WooHOuKS"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="JrcWqRyX"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lGv2ZTDzDqSq for ; Thu, 21 Feb 2019 17:40:55 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="WooHOuKS"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="JrcWqRyX"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3D4T26zDqCW for ; Thu, 21 Feb 2019 17:30:48 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 68B0222220; Thu, 21 Feb 2019 01:30:46 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=UzDBoubse5gQu H0I+3Ws+1Htt92Hhspi+Q0SDJ6JiMs=; b=WooHOuKSv7zqjSsNwt8DWbFwPazk2 eG0vlxXzWg0ufnBDyu41IKdEF1Uv6CZUrv+DmJ//MRAoymf50x9bfULzIWjxBN+S 3ZbVjgY9BK8c1sg4xW405AyUMr1dkEyvDJ6tpl8yLh7Hfttead/jJAZbsVo3sPyC uxI2yi8X1WSYT6Mnr1e83i1WlTT/FxbXk2Mr5qnDNEc0Zx1PCEHWVP0fhcuHWZtB x/Y3kOpd5R59cIXL2a0fjaOTkNb90A6z6VJL67/Wobw/4hQvCwvj0TXWGnmFrm1f +aXYjoRAbxCzNetVGAocqmcMfN/2zcJdlS6/6JgFsX2D71W/aglV2ocHQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=UzDBoubse5gQuH0I+3Ws+1Htt92Hhspi+Q0SDJ6JiMs=; b=JrcWqRyX gZ+UkDyDy2RlkbDzxz/acboNj7oLriOI2kzcVmusDPjv35vMf1zPYzmsxbqreo3t PNPnCZv7nQCaPsu9bFSSr4vCptu3Vbl5NfCdipVC7FnaTdMfUmBzjSko8pHItX6t JtiJioRkanHna62oGJNGp0GLTWygHG+LzD5LE6G7K6bt9OK/GlELpYM8xNZ+EdZY OQn+kj89+DkTF6AhpgjKmK6BidJ4lhW6mC86017am2Cp8OEHBlJB3ruBkwu/MpuQ GR/vEhwP4yrIMRuBGv9QkhJ38TW/xredjC/Xzu/ir6NIZAkaY0sB46No5/TeeW/W u/Szk8n/NDcWWA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peefke X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id D7B39E419A; Thu, 21 Feb 2019 01:30:43 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:41 +1030 Message-Id: <20190221062851.21958-43-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 42/52] test-ipmi-hiomap: Add create-read-window-malformed tests X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 95 ++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 016ec1f7519a..45f859bad1d0 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1880,6 +1880,99 @@ static void test_hiomap_get_flash_info_malformed_large(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_create_read_window_malformed_small[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 7, + .resp = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 4, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_create_read_window_malformed_small(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_create_read_window_malformed_small); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->read(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); + +} + +static const struct scenario_event +scenario_hiomap_create_read_window_malformed_large[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 9, + .resp = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 4, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_create_read_window_malformed_large(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_create_read_window_malformed_large); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->read(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -1925,6 +2018,8 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_get_info_malformed_large), TEST_CASE(test_hiomap_get_flash_info_malformed_small), TEST_CASE(test_hiomap_get_flash_info_malformed_large), + TEST_CASE(test_hiomap_create_read_window_malformed_small), + TEST_CASE(test_hiomap_create_read_window_malformed_large), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045821 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lHG5G7hz9s8m for ; Thu, 21 Feb 2019 17:41:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="MQ5wn7Vb"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ot0BLa3q"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lHG45BGzDqNQ for ; Thu, 21 Feb 2019 17:41:14 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="MQ5wn7Vb"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ot0BLa3q"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3G5xcvzDqCW for ; Thu, 21 Feb 2019 17:30:50 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id EFEDD2218B; Thu, 21 Feb 2019 01:30:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=PT+tW1MlojCFe Vk6byc76uFT8muk3a9e+IpkN8D7lgI=; b=MQ5wn7VbO0eAowrIGXn7BrlhiLeVy gTsUsAvqSt5QKwWuzrJK38SN/O9sIK3jiT4uZru+PZBP5u0/sXAntkgHNS3/yxEm h+U2YQbZtfwsWmLGqNzn/EFWpygzZhcksJJmd9qOzzEW1lNehOkd+j5LyhehnlpS XTDYRuKFTKmKaNrT71LbrRYwhnqafrY/vFePGVDi97hGCbowishSa7PUj9CFTufK IFACiDK/4Z7MOdbgPaWKvRhZJJiluf6HXziLmDXqLzB04Giy0TaZvTTf1tOgGC2Q ygsiHvx9EFolAAXiDfz/gBA4dDooT4J66Yx1EC4egZH+Pq8TCFaz8j7YA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=PT+tW1MlojCFeVk6byc76uFT8muk3a9e+IpkN8D7lgI=; b=ot0BLa3q mfLZr5KWsXpm7A0lbj58lYPkkXhIiwuDC0i8vMS5teKtxyv2vFP+otya0zigZhkm ZZGpjawWWKIGSOWXr2DBrA8lZjmpuG+/M0HXc+fmUz0uhCzIhoX0AGQLG/baNRbd Prnun0RsmIH4Luk+5iqGWQHVmKKTJQIFse88f583wPPCSSO0Dnn9SSH6w06JpV1z Rm4fY2+AUrjx4gUi6Ca1CmL/hp94pviyK0qa23MWEnD0qitAkuiVJQOwDcrJRWcG 5jBUHtz6xjJ7zb7bsBOZVQDxg1Je3HbsRwmlegefSdEP043+2fnLXsRwlbAh5zud HwuCeIuZGqLS+g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peefke X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 401B2E4597; Thu, 21 Feb 2019 01:30:46 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:42 +1030 Message-Id: <20190221062851.21958-44-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 43/52] test-ipmi-hiomap: Add create-write-window-malformed tests X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 95 ++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 45f859bad1d0..aa99b6074bad 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1973,6 +1973,99 @@ static void test_hiomap_create_read_window_malformed_large(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_create_write_window_malformed_small[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 7, + .resp = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 4, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_create_write_window_malformed_small(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_create_write_window_malformed_small); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->write(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); + +} + +static const struct scenario_event +scenario_hiomap_create_write_window_malformed_large[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 4, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp_size = 9, + .resp = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 4, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_create_write_window_malformed_large(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_create_write_window_malformed_large); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->write(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -2020,6 +2113,8 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_get_flash_info_malformed_large), TEST_CASE(test_hiomap_create_read_window_malformed_small), TEST_CASE(test_hiomap_create_read_window_malformed_large), + TEST_CASE(test_hiomap_create_write_window_malformed_small), + TEST_CASE(test_hiomap_create_write_window_malformed_large), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lHX1GBRz9s4Y for ; Thu, 21 Feb 2019 17:41:28 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="n/1Jjf36"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="UiauTCOS"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lHW6hlzzDqQ8 for ; Thu, 21 Feb 2019 17:41:27 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="n/1Jjf36"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="UiauTCOS"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3J5LFlzDqNB for ; Thu, 21 Feb 2019 17:30:52 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5A29322213; Thu, 21 Feb 2019 01:30:50 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=v1lCFv0jKGRcD ugxXUM1w1hHY77VOI5hQTz9GSSQzfw=; b=n/1Jjf36h7dYG278907i1yzTJbDv0 YbypZX4uSRQsx8F4Yb4pmKOzFUhL7kXOvrSjPIW390Nv6Ba11zllrjE1twB9M53i 5F/rQBTg3ab6CVOERiWfIkhC4+1hjbbpEmnfXsSXkg4BOWTQH8Zabup25odutqRv OxYondiJiniDcE8tq73K2XzT1gYFaDPuLd27Jpgh+xOc4sHdUsdi4kUY8S2+Nzau 8WK0ehBUysxFF9qV03hYgg/P70vHTwnHqMj8BGeLyHSeUC8De81yv0LhsQsOuD3Y vaAQ1fRhZv2F12zF4IPclaO+AD5omL+A+g3QaWbmt7cB+fu70Hppjll7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=v1lCFv0jKGRcDugxXUM1w1hHY77VOI5hQTz9GSSQzfw=; b=UiauTCOS zy+cffMrY8BUOzKkdX9Z8w9ZFSzWq0O12Z8pCyeUy/EC3Xtohau4TtoN37DjbXzb caaPCEc6F5PU1T4LkbwIhs3z0/ZwAl4gc+bWrdEtxXzKkn0srzLWMIyU6BddFfqz 0cVt0YEUb8IKr/IHAWky+2+cq5KDzeG2tfhf167LHGsB0XiPQGMCZCxHoItxXCMp sSsExgnmh32KoYaUusY3wQLBprw2+fZhYqOAX1assKgexaaM3F6nkTzkn6WqLbBz v8SiGGP3SKyp03eoJ9oEccImu1sxH9l7nr+l9lv986Bbktbg5jMcFsgCCBpOafLr UIbr1++1JeiPcw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peefke X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 7BA00E44A2; Thu, 21 Feb 2019 01:30:47 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:43 +1030 Message-Id: <20190221062851.21958-45-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 44/52] test-ipmi-hiomap: Add mark-dirty-malformed tests X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 101 +++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index aa99b6074bad..e491984e98de 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -2066,6 +2066,105 @@ static void test_hiomap_create_write_window_malformed_large(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_mark_dirty_malformed_small[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 5, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp_size = 1, + .resp = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 5, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_mark_dirty_malformed_small(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_mark_dirty_malformed_small); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->write(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); + +} + +static const struct scenario_event +scenario_hiomap_mark_dirty_malformed_large[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 5, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp_size = 3, + .resp = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 5, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_mark_dirty_malformed_large(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_mark_dirty_malformed_large); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->write(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -2115,6 +2214,8 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_create_read_window_malformed_large), TEST_CASE(test_hiomap_create_write_window_malformed_small), TEST_CASE(test_hiomap_create_write_window_malformed_large), + TEST_CASE(test_hiomap_mark_dirty_malformed_small), + TEST_CASE(test_hiomap_mark_dirty_malformed_large), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lHn2qH5z9s4Y for ; Thu, 21 Feb 2019 17:41:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="WHJnqChi"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZrQfE3y1"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lHn1nwjzDqSx for ; Thu, 21 Feb 2019 17:41:41 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="WHJnqChi"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZrQfE3y1"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3L5kY9zDq6X for ; Thu, 21 Feb 2019 17:30:54 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9CCE12217B; Thu, 21 Feb 2019 01:30:52 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=STiDYRhVD6puu iVhnj4CKoqc2DFRhq5cEcdQf0ck8WU=; b=WHJnqChiVpSG1Q66RNUDT6kCJrNyv Ie2uz7p8GFzj/tvFkjL7SzcKHgiGQQuPWP6LKekAINs+7hU9IKV8Q43gBontFNcP wXlncfX/a1OBLhzO05l1Elsp6YIV8HLhUb1u2FWFWegR1qHm9qTFBEb99Dky4ReF EULd/uOanvf0keYE7PeO3JUiJHakelZ3EZtUrxxExO1ypLevSOLFnBIOHD7bNlso UMYlRrMK7AhmrjBpp48glq2wKqwFuKyfsySaJCbVIVSF3NbvwBzP3S3EF6PbYWpw sUBzOXjWugFAuQBuzdwI/4A/9GC8IByJqe8eG+9t4qS8f+dDiAx97sl/w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=STiDYRhVD6puuiVhnj4CKoqc2DFRhq5cEcdQf0ck8WU=; b=ZrQfE3y1 5jd349wqvZm9lRIezknhqyLwL/qdaOL+1njBma6CRNAJZTJIqsa/d9P7mrPDlRgs EVG9UapI9Z6ljbd3XfWdpXmqdWhgGVUdOE65WVDtxCN7PaZuwq0Yb4omtqdm8F7z S8dRpBmF/Ujc17wecv1PpZZVH0AQsgo7OeBE5xqvg9OyNG0RT6LfFWEs2QTX2I9m T+p9qVZ9DwGWA4A+SUPY4HT9w4ZibLfdjaNoygh6mwCTlypMEY/R/W9WZbvazjYC HsQj0bHPGynqd8Y7X+pgk5dhuDqRFPK/KUNred+TxP4M4Mj5G00dRgdcIxz7BCU0 S4EkOQSDIBy+cA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peegud X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id B94FAE4210; Thu, 21 Feb 2019 01:30:50 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:44 +1030 Message-Id: <20190221062851.21958-46-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 45/52] test-ipmi-hiomap: Add flush-malformed tests X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 95 ++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index e491984e98de..e678b88108a9 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -2165,6 +2165,99 @@ static void test_hiomap_mark_dirty_malformed_large(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_flush_malformed_small[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_mark_dirty_qs0l1_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 6, + }, + .resp_size = 1, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 6, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_flush_malformed_small(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_flush_malformed_small); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->write(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); + +} + +static const struct scenario_event +scenario_hiomap_flush_malformed_large[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_mark_dirty_qs0l1_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 6, + }, + .resp_size = 3, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 6, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_flush_malformed_large(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_flush_malformed_large); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(bl->write(bl, 0, buf, len) > 0); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -2216,6 +2309,8 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_create_write_window_malformed_large), TEST_CASE(test_hiomap_mark_dirty_malformed_small), TEST_CASE(test_hiomap_mark_dirty_malformed_large), + TEST_CASE(test_hiomap_flush_malformed_small), + TEST_CASE(test_hiomap_flush_malformed_large), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045824 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lJ25J3mz9s4Y for ; Thu, 21 Feb 2019 17:41:54 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="xSkovOGC"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="aS3IF1C4"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lJ2433ZzDqQC for ; Thu, 21 Feb 2019 17:41:54 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="xSkovOGC"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="aS3IF1C4"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3N5xqSzDqNN for ; Thu, 21 Feb 2019 17:30:56 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9D52D21F79; Thu, 21 Feb 2019 01:30:54 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=WTcZ6q5OeExOa T3UxHan9cKSf32S5GIZi8inmb8Q2NA=; b=xSkovOGCjLlWPBQZbCMpBw7IRav07 VWE/RQwjUDwsXSvfRcn/kTgnSxLBJi1YBVMUfR86b7Lb0TcyUO8FKFfZB3eM4Cb0 WoRM5x9FS5IAPcLLv3GxGRVUihMtV1V4lu1bXJJDnnAwzBlparrr86gu1tURmGKi BTEJTgnA3o2or0ileYE7Wkk2+VvY8k3K5RrZIv3Do0F+0nowTc+BkZyTEPcEyE3N vVf+O+0sVbkbVJmbdHWfFwkYA8g8WmO2de1roghJLp6IFwXEY0u8QfplBwnRwSu7 hiLJD/H313CNVXjp2HVjbb2UMzcXm52ecEiz9stP7RcghZyhjyAV14fRw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=WTcZ6q5OeExOaT3UxHan9cKSf32S5GIZi8inmb8Q2NA=; b=aS3IF1C4 aTKYp7oRJOUSWZVawaAxXqmVMh3p3cLABuzAPAXiqo6GIn8E3sEbv22TiRxv5l26 EKB9mqdVXq8abZVgaesys0XZ7gsHtJnlh29EPQsPIleXPCivj4NaMZN7kBSia7Fc GR4UWa3loDQB1OPzu4nCeSPvPq7D7hmch1w8+XSgVA3XkdvOEVBQFijak/yijagE 6tbuCTmz1LEW5DbPEM7W8m7h/vVbr2KaRPR77CY0bzhvmZia+Kt0DTIWWDhXClIW +pxcS5DV9OCcxAK2UuICqKWzHO6CDxnB/pvd4NbuTbJYOK4UcGlVrVSgNKqmsj4h 3frwGpUxm22dUA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peegud X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id E88F0E419A; Thu, 21 Feb 2019 01:30:52 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:45 +1030 Message-Id: <20190221062851.21958-47-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 46/52] test-ipmi-hiomap: Add erase-malformed tests X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 92 ++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index e678b88108a9..f5ac725b8083 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -2258,6 +2258,96 @@ static void test_hiomap_flush_malformed_large(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_erase_malformed_small[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 5, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp_size = 1, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 5, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_erase_malformed_small(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_erase_malformed_small); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + assert(bl->erase(bl, 0, len) > 0); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + +static const struct scenario_event +scenario_hiomap_erase_malformed_large[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 5, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp_size = 3, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 5, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_erase_malformed_large(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_erase_malformed_large); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + assert(bl->erase(bl, 0, len) > 0); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -2311,6 +2401,8 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_mark_dirty_malformed_large), TEST_CASE(test_hiomap_flush_malformed_small), TEST_CASE(test_hiomap_flush_malformed_large), + TEST_CASE(test_hiomap_erase_malformed_small), + TEST_CASE(test_hiomap_erase_malformed_large), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045825 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lJH63zRz9s4Y for ; Thu, 21 Feb 2019 17:42:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="O4ncCYSK"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="yA7404w9"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lJH4wSwzDqR7 for ; Thu, 21 Feb 2019 17:42:07 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="O4ncCYSK"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="yA7404w9"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3S2Bs9zDqNN for ; Thu, 21 Feb 2019 17:30:59 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E715622281; Thu, 21 Feb 2019 01:30:56 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=smK6noa9iqkqT k9UvAjV3gocfZZjTGq35C6ZIvmEiEk=; b=O4ncCYSKfAiQj6ExKNYwRXkxnh/GC 2fOSU/EO3Eb2KvXvfS3dv6w8AhXf/rcttjJ+8QSion3npPoCPaCMHAMspttnBSYF pRQbkR2RdVHviaGGt/31VUw0g3wm+A48B+0jL499xh+ZMu3Y4iINQWE8MXAZPVd8 FEi1KKePgMjoGk8SNlUJwThuLaCcSPUe7pmv5xnXSdDYKDouI9Rzh4pTowfUsGxY +aOQI9L1pcSmLpcDf2DwELlGQeVAg5kI/C3CZL7FWp4eqW5F8x8l+VTPdG356llc 7hY4430K+i2/xvq1wSJxyvH5F3h1PNLvYu65/8vo1D89HEJ2Sr6KbHe3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=smK6noa9iqkqTk9UvAjV3gocfZZjTGq35C6ZIvmEiEk=; b=yA7404w9 YaXccQoPUZ3OMFiJrOVkgrYXEYHVtQjv2mGsnxUSg9gq2WHwCbrcVz3qQbYcQ36t XCPQwrvXDFhF/N9gadDsHFsv2y7E6tY/9QLSzbhmGV9pKbzQ0DbwMIGtmM2xdbhb mCmSVbUg96OkQo8fZ56/FuTJNfM1R6Q1/1dEbQH3KMVDR7DeOJ2jS+WjWy8eCdxL 4NxZNPjb6srRMOak+LSAUFEFHZ03KmVol7T3MsgdaL6VxhiF7QcQ8Iec7m8LOUic BiN6SjMMKu4NJHfvIYz0PgBff9oE6jrnkqk+B4Xy6kOAHKA/QFv6AKVZJdYeuaWH PZsTR9hSEXvhAA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peegud X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id BA918E419A; Thu, 21 Feb 2019 01:30:54 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:46 +1030 Message-Id: <20190221062851.21958-48-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 47/52] test-ipmi-hiomap: Add protocol-recovery-failure-ack test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 170 +++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index f5ac725b8083..5e75a9c24490 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -2348,6 +2348,175 @@ static void test_hiomap_erase_malformed_large(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_recovery_failure_ack[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_erase_qs0l1_call, }, + { .type = scenario_event_p, .p = &hiomap_flush_call, }, + { .type = scenario_delay }, + { + .type = scenario_sel, + .s = { + .bmc_state = HIOMAP_E_DAEMON_READY | + HIOMAP_E_PROTOCOL_RESET + } + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 7, + .args = { + [0] = HIOMAP_E_PROTOCOL_RESET, + }, + }, + .cc = IPMI_ERR_UNSPECIFIED, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 8, + .args = { + [0] = HIOMAP_E_PROTOCOL_RESET, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 8, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 9, + .args = { + [0] = HIOMAP_V2, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 9, + .args = { + [0] = HIOMAP_V2, + [1] = 12, + [2] = 8, [3] = 0, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 10, + .args = { + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 10, + .args = { + [0] = 0x00, [1] = 0x20, + [2] = 0x01, [3] = 0x00, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 11, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 11, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 12, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 12, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 13, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 13, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_recovery_failure_ack(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_protocol_recovery_failure_ack); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + /* + * We're erasing the same block 3 times - it's irrelevant, we're just + * trying to manipulate window state + */ + assert(!bl->erase(bl, 0, len)); + scenario_advance(); + assert(bl->erase(bl, 0, len) > 0); + assert(!bl->erase(bl, 0, len)); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -2403,6 +2572,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_flush_malformed_large), TEST_CASE(test_hiomap_erase_malformed_small), TEST_CASE(test_hiomap_erase_malformed_large), + TEST_CASE(test_hiomap_protocol_recovery_failure_ack), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lJY0Ft6z9s4Y for ; Thu, 21 Feb 2019 17:42:21 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="dMB1itD6"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="7Ta7+5gd"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lJX663CzDqQk for ; Thu, 21 Feb 2019 17:42:20 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="dMB1itD6"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="7Ta7+5gd"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3T3v9LzDq6X for ; Thu, 21 Feb 2019 17:31:01 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5294722167; Thu, 21 Feb 2019 01:30:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:30:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=vyXbUheVdNzGS oGA1KS9ME4ZmAvNjpYhbPTxGRlaP/8=; b=dMB1itD6JHvqOQjunuAY/fRuCx4ZF gfubGcBh1y1ROm0kp1P444uUY690OLVRkYc/wWiUHMeg+sMSCg0gjRIQ+4PAkZDB FuIkOTQX3bOXM+q2YiPUcELig3k9lvq15Fi0knfSG/IMhUdb3cRBSxCQrRzzlFR9 XaFddOWECXF/XNMhScuiwyPMkiDcEJgtiywYuUa2n1MbyPHzDooakkkJ8g4EaRFO 8n0uxaRy1P5l0jNLBUYiT/4FJPKuXzVYnS427F0bYL2KCWJZ52rr5FtygwbgDF1M 1vAYHD9mk+Y+Hs82+373Krit0+c6AaXgI8CTxWxaG9giiaqtxcaOxSl9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=vyXbUheVdNzGSoGA1KS9ME4ZmAvNjpYhbPTxGRlaP/8=; b=7Ta7+5gd xe/mEJ/K3eFftoup989JQm8tfjFaXNyOc9WtTMq5JV9kn+xKQ5gZkxy8RdmQfAmu io8L/9Sa5tUWGtdQ5V9UaLOrBeQFSMv9fzTHCBgIjS0Iwx0bRY8bDPZngxsqI18U O/RWqfEC1IL69NgQBJb0dw8gofEakk2A3akQ0lQV7vSqLTDJbGIzn/eSY5+jg4ZY 1Lp+EbfjSTHeCsA711tjiY+Smy7UCqMCPALbZvqBYSlkD18Yp4TrkrZ9FiDaTbnm yNh1PQUWyq5HwnD0xM4McTXYnPrgso14xkcOcSS4KXRYNkULaFFvr7Vd4xvnSu84 Utehs9K3qQulzw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peegge X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 1FB83E419A; Thu, 21 Feb 2019 01:30:56 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:47 +1030 Message-Id: <20190221062851.21958-49-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 48/52] test-ipmi-hiomap: Add protocol-recovery-failure-get-info test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 191 +++++++++++++++++++++++++++++++ 1 file changed, 191 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 5e75a9c24490..d2e3da78136f 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -2348,6 +2348,26 @@ static void test_hiomap_erase_malformed_large(void) scenario_exit(); } +/* Common recovery calls */ + +static const struct scenario_event hiomap_recovery_ack_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 7, + .args = { + [0] = HIOMAP_E_PROTOCOL_RESET, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 7, + }, + }, +}; + static const struct scenario_event scenario_hiomap_protocol_recovery_failure_ack[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -2517,6 +2537,176 @@ static void test_hiomap_protocol_recovery_failure_ack(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_recovery_failure_get_info[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_erase_qs0l1_call, }, + { .type = scenario_event_p, .p = &hiomap_flush_call, }, + { .type = scenario_delay }, + { + .type = scenario_sel, + .s = { + .bmc_state = HIOMAP_E_DAEMON_READY | + HIOMAP_E_PROTOCOL_RESET + } + }, + { .type = scenario_event_p, .p = &hiomap_recovery_ack_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 8, + .args = { + [0] = HIOMAP_V2, + }, + }, + .cc = IPMI_ERR_UNSPECIFIED, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 9, + .args = { + [0] = HIOMAP_E_PROTOCOL_RESET, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 9, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 10, + .args = { + [0] = HIOMAP_V2, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 10, + .args = { + [0] = HIOMAP_V2, + [1] = 12, + [2] = 8, [3] = 0, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 11, + .args = { + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 11, + .args = { + [0] = 0x00, [1] = 0x20, + [2] = 0x01, [3] = 0x00, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 12, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 12, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 13, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 13, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 14, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 14, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_recovery_failure_get_info(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_protocol_recovery_failure_get_info); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + /* + * We're erasing the same block 3 times - it's irrelevant, we're just + * trying to manipulate window state + */ + assert(!bl->erase(bl, 0, len)); + scenario_advance(); + assert(bl->erase(bl, 0, len) > 0); + assert(!bl->erase(bl, 0, len)); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -2573,6 +2763,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_erase_malformed_small), TEST_CASE(test_hiomap_erase_malformed_large), TEST_CASE(test_hiomap_protocol_recovery_failure_ack), + TEST_CASE(test_hiomap_protocol_recovery_failure_get_info), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045827 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lJn3X0Bz9s4Y for ; Thu, 21 Feb 2019 17:42:33 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="J1wFLQxh"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="M9ba458t"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lJn2C5pzDqSB for ; Thu, 21 Feb 2019 17:42:33 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="J1wFLQxh"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="M9ba458t"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3W3hZMzDqCW for ; Thu, 21 Feb 2019 17:31:03 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4F135221DC; Thu, 21 Feb 2019 01:31:01 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:31:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=1U0am/GCxrWs+ 6aI7NpNlIREX3eawLn6pc6rN7oiYCM=; b=J1wFLQxhy52FKio71mZ/Lv8FRDrtV 0CRA0rUvovIDXdagLI3pI60mV0Jdr2XHM+HkdkfgttjguqOxmc1CRUx9Esiqoi93 Qdo65UGRIysWi0r5CBy8uwaZr2FxOFCDi+pW7c11J2+uj/6nKQsYj/gx02rifOac T6NS/3tn/VzhuaRywkcLwrAqtSI+Pj3y2n5LsOjkTz1WeJ8N4tJhhrwJp5KcdaSE LwFt1X4tfktzwkLO2vQCbruEdNkx257sjeKEizobQnShWgqihkuBiI6pL+UoUeSn 6JLmvwwYFRNyu7CESUoqMUneNcuy38bpc7h+lUdvdfcG4vot7RqigZ4Zg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=1U0am/GCxrWs+6aI7NpNlIREX3eawLn6pc6rN7oiYCM=; b=M9ba458t wm42r+vumM4x3zrFAWfXQ0tKSYc4ScjS66oBvEyqnGJEU61/1bU+/9whZJ4UuJSI gavggq53zJO5GO9qhtrX6mGvXdvpuBRm6WftmdmuRS/KsKTohg9SUqpuPCJQdgjZ A/ZoDBKezgEvDoQq5Wp8+Hh2H6716jQcPPZQisp5ohdVK0+38KgyHIyiOE5pqmB3 iqmi8/EYKj3ljj7h9ygkxz8G5Ifxg7T4xkD3XQ5aqmqtsLEw3m8Gh+OzlniJ6mwx BZ3xjk9zguLNqQjsrOMIH3/7ckGlhW46IhDcHp221xzti7nzKY3GBfsN1SN2N0cf Dikmg/ro84c9bA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peegge X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 8235DE419A; Thu, 21 Feb 2019 01:30:59 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:48 +1030 Message-Id: <20190221062851.21958-50-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 49/52] test-ipmi-hiomap: Add protocol-recovery-get-flash-info-failure test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 195 +++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index d2e3da78136f..79945b3372f8 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -2368,6 +2368,29 @@ static const struct scenario_event hiomap_recovery_ack_call = { }, }; +static const struct scenario_event hiomap_recovery_get_info_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 8, + .args = { + [0] = HIOMAP_V2, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 8, + .args = { + [0] = HIOMAP_V2, + [1] = 12, + [2] = 8, [3] = 0, + }, + }, + }, +}; + static const struct scenario_event scenario_hiomap_protocol_recovery_failure_ack[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -2707,6 +2730,177 @@ static void test_hiomap_protocol_recovery_failure_get_info(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_recovery_failure_get_flash_info[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_erase_qs0l1_call, }, + { .type = scenario_event_p, .p = &hiomap_flush_call, }, + { .type = scenario_delay }, + { + .type = scenario_sel, + .s = { + .bmc_state = HIOMAP_E_DAEMON_READY | + HIOMAP_E_PROTOCOL_RESET + } + }, + { .type = scenario_event_p, .p = &hiomap_recovery_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_recovery_get_info_call}, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 9, + }, + .cc = IPMI_ERR_UNSPECIFIED, + }, + + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 10, + .args = { + [0] = HIOMAP_E_PROTOCOL_RESET, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 10, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 11, + .args = { + [0] = HIOMAP_V2, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 11, + .args = { + [0] = HIOMAP_V2, + [1] = 12, + [2] = 8, [3] = 0, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 12, + .args = { + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 12, + .args = { + [0] = 0x00, [1] = 0x20, + [2] = 0x01, [3] = 0x00, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 13, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 13, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 14, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 14, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 15, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 15, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_recovery_failure_get_flash_info(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_protocol_recovery_failure_get_flash_info); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + /* + * We're erasing the same block 3 times - it's irrelevant, we're just + * trying to manipulate window state + */ + assert(!bl->erase(bl, 0, len)); + scenario_advance(); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + assert(bl->erase(bl, 0, len) > 0); + assert(!bl->erase(bl, 0, len)); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -2764,6 +2958,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_erase_malformed_large), TEST_CASE(test_hiomap_protocol_recovery_failure_ack), TEST_CASE(test_hiomap_protocol_recovery_failure_get_info), + TEST_CASE(test_hiomap_protocol_recovery_failure_get_flash_info), { NULL, NULL }, }; From patchwork Thu Feb 21 06:28:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045828 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lK50nrzz9s4Y for ; Thu, 21 Feb 2019 17:42:49 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="KfLYOKgn"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="P06M5p5K"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lK46D1czDqGP for ; Thu, 21 Feb 2019 17:42:48 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="KfLYOKgn"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="P06M5p5K"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3Y3CznzDq6X for ; Thu, 21 Feb 2019 17:31:05 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3AC9D221E2; Thu, 21 Feb 2019 01:31:03 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:31:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=NV/SXaZijw991 BgeuiRf0S5N8vi9htbsyFaB3PNlvvo=; b=KfLYOKgngO7j7Cf/QvsdoQU14IqJf Rr3/o1W47BhZro0UCep8SDdMFxNnTb4NQ7VP3fOpk1trNwv7zjOF7uALHZSTNPjh Y7/LmUfIr/wqEvmww9JWxMKJTDykESJ0hHXESQrLoI6jlCqx7kPxOCkPaNpJcByi qSW+KMVg9s289bLzwrOPmAaYlyAOMoSlhhsfs/3/p13upTWb4HW7y3mVRN4IpnQZ kIq7VXztXIGBXHAs2275IxfLZmGtqF3SGx1cjGc6ZCzX3A0/PQJdRkXbSxZm2jBw osOsPNGJQV+2QRHaWXVVkQT0ab5hqhFDVw2CYp14Elf4eQ4WRtOgL5HBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=NV/SXaZijw991BgeuiRf0S5N8vi9htbsyFaB3PNlvvo=; b=P06M5p5K vouKtFBkslyWcslM5Mbb++91zUJllV0AiFOIeU0lVh1mJNgOnjvcSsywOPd+DzsO 7Nk+NszRBtYrD30Lp7urQPSzqLyOm8bzMZ4f21RrOLTBgeDSxJgrCFi77ztN6QFC rIzGQgFxpZeuKnmwmoXAPeGLQwAFSv0IwVTWv9YJj0FYt7JqBNhfFvmycjbTYA7Z RDZj2DtdVViv5owR5nxzK3aKTnnZheK6eiQ+pGPedmR0o8VIC+c0xoURfuJ7N8Kq EC18YNJYzV5O0QwxYRaHWqG8eo+ZysuYPS4rkatdP+y5NXiLcjUDRGS4IqAcVQSR UVncp6hBg2KFcQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peegge X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 7E5EEE419A; Thu, 21 Feb 2019 01:31:01 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:49 +1030 Message-Id: <20190221062851.21958-51-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 50/52] test-ipmi-hiomap: Add read-one-block-twice test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 79945b3372f8..0222f4da0936 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -926,6 +926,38 @@ static void test_hiomap_protocol_read_two_blocks(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_read_one_block_twice[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_read_window_qs0l1_rs0l1_call, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_read_one_block_twice(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + uint8_t *buf; + size_t len; + + scenario_enter(scenario_hiomap_protocol_read_one_block_twice); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(!bl->read(bl, 0, buf, len)); + assert(!bl->read(bl, 0, buf, len)); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static const struct scenario_event scenario_hiomap_protocol_event_before_action[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -2918,6 +2950,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_reset_recovery), TEST_CASE(test_hiomap_protocol_read_one_block), TEST_CASE(test_hiomap_protocol_read_two_blocks), + TEST_CASE(test_hiomap_protocol_read_one_block_twice), TEST_CASE(test_hiomap_protocol_event_before_read), TEST_CASE(test_hiomap_protocol_event_during_read), TEST_CASE(test_hiomap_protocol_write_one_block), From patchwork Thu Feb 21 06:28:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045829 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lKL1Fbpz9s4Y for ; Thu, 21 Feb 2019 17:43:02 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="ACpWIbQT"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="LrCApD/V"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lKL09B2zDqSn for ; Thu, 21 Feb 2019 17:43:02 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="ACpWIbQT"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="LrCApD/V"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3b4rJlzDqN8 for ; Thu, 21 Feb 2019 17:31:07 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 171502217B; Thu, 21 Feb 2019 01:31:05 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:31:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=nHjuFRk1vXiML m6GN2WpbTwQH3DjCvqwVkZ6Iy3sqA4=; b=ACpWIbQTSVsDl2Xk7vlmSW0ULcgEv lhwNL7mhnewX2DBJ5+za3OUh1TkOy0B2M5sSMwrHTOCY1mYqu9ypnH1mODgn4EY4 4oJVnglSgCZDvL2DpBkMJuYnfzNtlo4GCU41w/eUv2gYSYtfZHuC7Pay+T/4sxd6 LmkHKVUICKsKLhOOqK26KVadu9TSjStnoJveFn9AYgAXJ8ci6/m00pNS1sm4gpll 2Jm8d0QK/fsGg5y8A5l9OhR5rWEs8LCuY/bwz4qXlU6mqz6cDZNPNteOcZlKjxZx cvJrRyM8QwD/WmQUtNpVD510H/x/DEQJ9buPxtmbp6s/6sTtO9edjE80w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=nHjuFRk1vXiMLm6GN2WpbTwQH3DjCvqwVkZ6Iy3sqA4=; b=LrCApD/V c08wzDmUGPzqJfYGKINI7D8KTnacYcluRb4nOAuD4J7REpXL8OqFZFRqnHgGyYj6 nd6USMLz88M2l80G3bxnUL3HvB3X7g436KW1pJlQoSQOfyVUpWqq4dDa6ESvCB/S 1LiDsCAK/q58Eg+3ev+p+Tb4gzwxb+tl6oqg2zWaEa0FCXf9ta1Fcpr77BxkG9+m f2t2+RQRfP2mntQN1aOt3pb41z/fG8lb+RLStPu+LigMGazU2IOZmpsdnjyHsSqo X3hQ+d/ieu2EP3BE9X//fTBwsQwjk/WJmHEHehtNHVGxkG9CgKCurDzejvxq8rOr RG97SWahgc0tAg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peegje X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 69FA3E4597; Thu, 21 Feb 2019 01:31:03 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:50 +1030 Message-Id: <20190221062851.21958-52-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 51/52] test-ipmi-hiomap: Add write-one-block-twice test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 65 ++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 0222f4da0936..7042e2f72377 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1127,6 +1127,70 @@ static void test_hiomap_protocol_write_two_blocks(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_write_one_block_twice[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_mark_dirty_qs0l1_call, }, + { .type = scenario_event_p, .p = &hiomap_flush_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 7, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_MARK_DIRTY, + .seq = 7, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 8, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 8, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_write_one_block_twice(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + uint8_t *buf; + size_t len; + + scenario_enter(scenario_hiomap_protocol_write_one_block_twice); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + buf = calloc(1, len); + assert(buf); + assert(!bl->write(bl, 0, buf, len)); + assert(!bl->write(bl, 0, buf, len)); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static void test_hiomap_protocol_event_before_write(void) { struct blocklevel_device *bl; @@ -2955,6 +3019,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_event_during_read), TEST_CASE(test_hiomap_protocol_write_one_block), TEST_CASE(test_hiomap_protocol_write_two_blocks), + TEST_CASE(test_hiomap_protocol_write_one_block_twice), TEST_CASE(test_hiomap_protocol_event_before_write), TEST_CASE(test_hiomap_protocol_event_during_write), TEST_CASE(test_hiomap_protocol_erase_one_block), From patchwork Thu Feb 21 06:28:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1045830 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 444lKb1ckjz9s4Y for ; Thu, 21 Feb 2019 17:43:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="OPQi27Nl"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="rLLx+/Ay"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 444lKb0DNpzDqSk for ; Thu, 21 Feb 2019 17:43:15 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=aj.id.au (client-ip=66.111.4.26; helo=out2-smtp.messagingengine.com; envelope-from=andrew@aj.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=aj.id.au Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aj.id.au header.i=@aj.id.au header.b="OPQi27Nl"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="rLLx+/Ay"; dkim-atps=neutral Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 444l3d2x9mzDqN8 for ; Thu, 21 Feb 2019 17:31:09 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2FF9A22206; Thu, 21 Feb 2019 01:31:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 21 Feb 2019 01:31:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=hc/bwy2+aNAXu uP2YDGX3ZVhxlocy4Ht7FDUUDakXgs=; b=OPQi27NlIvPE2D3WfbhrY/8qi/PST AlqwTcFcNj+r5fGNkbKd5j1b8dYjPd5LGb3ZedCnTd/o12PAQ6dVAuKKSMOdkZ9r nSanIsOWNkaad3Miy3P2+R1sgjnw9+U7NtnG11gI7FQxnrXYGIvkjA5EWAQb0iks y2HitZajjBYSxM2VpfaethuBXpRHnc0NR0oNFFqrloSF/M70WV7dzMJQPDyXXVaf xPeaONFAWQRS9gqOMdsYwKu11ksyowRCINiWZb6IXlCb156Co9SLc0fA7GMnk/5/ Uc8SjLzQU0r9VDKvqi9IF5Ytug1wlmsJjV0XKHOW6SizpPJqtgpM8JjqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=hc/bwy2+aNAXuuP2YDGX3ZVhxlocy4Ht7FDUUDakXgs=; b=rLLx+/Ay SfvGfmG9V6XW3HDDppjevBbyOXsVgrtx166QSoyCvyyYx0pYUwcLJ6/4hGmvEbNM wpo5vHVBLMVBvhVcw4dEUB5PjKSQvVG9PPKeYs/UcW4DgRZHINxvx5yT7Es9Xvnc wyNzlYaywX9a7Y8FwNBHLb6bDiClHYsU8Y1affv82Bevwdda+dJB88KIAjePey4B gJ9We0VXRURMsa0Rtry3wrMoGZVqilOdBBL/5aCUx2NWEki12Q1qCzUqSWq4yHr4 H2/e9igPXITwyC46CWg5C9/C7J/e2raN+5Fncj5wluGILoYnoye2WVuazqfUQc5m 4ClZauA/RChFlA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrtdejgdeljeculddtuddrgedtledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegr jhdrihgurdgruheqnecukfhppedvtddvrdekuddrudekrddvkeenucfrrghrrghmpehmrg hilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigv peegje X-ME-Proxy: Received: from mistburn.bha-au.ibmmobiledemo.com (unknown [202.81.18.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 66C72E419A; Thu, 21 Feb 2019 01:31:05 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Thu, 21 Feb 2019 16:58:51 +1030 Message-Id: <20190221062851.21958-53-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190221062851.21958-1-andrew@aj.id.au> References: <20190221062851.21958-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH v2 52/52] test-ipmi-hiomap: Add erase-one-block-twice test X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Cc: stable Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 7042e2f72377..dc855c5a101e 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -1328,6 +1328,66 @@ static void test_hiomap_protocol_erase_two_blocks(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_erase_one_block_twice[] = { + { .type = scenario_event_p, .p = &hiomap_ack_call, }, + { .type = scenario_event_p, .p = &hiomap_get_info_call, }, + { .type = scenario_event_p, .p = &hiomap_get_flash_info_call, }, + { + .type = scenario_event_p, + .p = &hiomap_create_write_window_qs0l1_rs0l1_call, + }, + { .type = scenario_event_p, .p = &hiomap_erase_qs0l1_call, }, + { .type = scenario_event_p, .p = &hiomap_flush_call, }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 7, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 7, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 8, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 8, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_erase_one_block_twice(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_protocol_erase_one_block_twice); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + assert(!bl->erase(bl, 0, len)); + assert(!bl->erase(bl, 0, len)); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + static void test_hiomap_protocol_erase_one_block(void) { struct blocklevel_device *bl; @@ -3024,6 +3084,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_event_during_write), TEST_CASE(test_hiomap_protocol_erase_one_block), TEST_CASE(test_hiomap_protocol_erase_two_blocks), + TEST_CASE(test_hiomap_protocol_erase_one_block_twice), TEST_CASE(test_hiomap_protocol_event_before_erase), TEST_CASE(test_hiomap_protocol_event_during_erase), TEST_CASE(test_hiomap_protocol_bad_sequence),