From patchwork Fri Feb 15 06:56:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042610 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 4413xt0Zdlz9s4Z for ; Fri, 15 Feb 2019 17:58:26 +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="Y+n4+au7"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="oVoqkIm2"; 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 4413xs63zwzDqTq for ; Fri, 15 Feb 2019 17:58: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="Y+n4+au7"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="oVoqkIm2"; 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 4413wr51wRzDqTF for ; Fri, 15 Feb 2019 17:57:32 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id CA09F22213; Fri, 15 Feb 2019 01:57:28 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57: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-type:content-transfer-encoding; s=fm2; bh= fOcndl3wT9Q0kQdv++lydahi22bKb11585hYVwIzffc=; b=Y+n4+au7++5imEVE 1Ia8l0vPWKCBeb7OZFJ+UprO+KNTEsAxryZuBrzj/Vn/UsKTNb59AILUitOeiW/P xuGWFp3ZXUwuPFmUbBGX2q90HbybXVUjyyEjJ2GOP2CWBHc6VpOcS0/KUY4dpxJX dqLTrho0rWiOmvMmX1y9vFT/rASf+MYWowYvowjZ1ONgYj+HLNs4KLJnb7M7eUPO z9DRp9BW/IUPKYCaBW71zzTH2xvUfUs+g1fHBIMLqQeRQrbLvK6KZoY4Y2Gonw0C vwlQmmjv5mGzIr3xHFy1F9zRfp+tWLi3L7QZV2aPMdrbTGnDRr2IjIIY4fZHwasG 1dysMw== 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=fOcndl3wT9Q0kQdv++lydahi22bKb11585hYVwIzf fc=; b=oVoqkIm2ROiuNFeSvyuRf8QmDxXzccfCRt+r0eiYwpxeu1J29e4cTEw0D eAglnQZcouv+bX4C/+cpjAe/7KU7FUF2k0BB6eL+eKgWt7bgG8cldQcJcfhRrPp5 2iLy39QJX3hCkT8iG9ELPMU5nO/SVW2Ts19QYfvXv7p993yIh74xYalp3FEZuibD CBNR1WcMGg5tMtembXlnMxegUsuT4Xj3lRmCUKynB0wdhFLXUD/hEZwgXAXxok5Q 4B1YMmOaYNNBi8UBpGTduGkI621RyXixIfGBQTjpTPQzhfPgSkMJgRhm28h1Qyto 02UeyQymv485xSvaLrna29U0wP1bw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomh eptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegrjhdrihgurdgruheqnecu kfhppedugedrvddrkeelrdejheenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvg ifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id D4586E409D; Fri, 15 Feb 2019 01:57:26 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:18 +1030 Message-Id: <20190215065708.6086-2-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 01/51] stubs: Remove __attrconst annotation 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 check` with gcc 8.2.0 (Ubuntu 8.2.0-7ubuntu1) produces the following warnings: [ HOSTCC ] core/test/stubs.c core/test/stubs.c:80:1: warning: ‘const’ attribute on function returning ‘void’ [-Wattributes] { ^ core/test/stubs.c:87:1: warning: ‘const’ attribute on function returning ‘void’ [-Wattributes] { ^ [ HOSTCC ] hdata/test/stubs.c hdata/test/stubs.c:122:1: warning: ‘const’ attribute on function returning ‘void’ [-Wattributes] { ^ hdata/test/stubs.c:131:1: warning: ‘const’ attribute on function returning ‘void’ [-Wattributes] { ^ Signed-off-by: Andrew Jeffery --- core/test/stubs.c | 4 ++-- hdata/test/stubs.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/test/stubs.c b/core/test/stubs.c index 66252f8a1e92..0e80e057d1e4 100644 --- a/core/test/stubs.c +++ b/core/test/stubs.c @@ -76,14 +76,14 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu, return NULL; } -void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it) +void cpu_wait_job(struct cpu_job *job, bool free_it) { (void)job; (void)free_it; return; } -void __attrconst cpu_process_local_jobs(void) +void cpu_process_local_jobs(void) { } diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c index ab6e2cec1344..f7b1da105e0e 100644 --- a/hdata/test/stubs.c +++ b/hdata/test/stubs.c @@ -118,7 +118,7 @@ struct cpu_job *__cpu_queue_job(struct cpu_thread *cpu, void cpu_wait_job(struct cpu_job *job, bool free_it); -void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it) +void cpu_wait_job(struct cpu_job *job, bool free_it) { (void)job; (void)free_it; @@ -127,7 +127,7 @@ void __attrconst cpu_wait_job(struct cpu_job *job, bool free_it) void cpu_process_local_jobs(void); -void __attrconst cpu_process_local_jobs(void) +void cpu_process_local_jobs(void) { } From patchwork Fri Feb 15 06:56:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042609 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 4413xR1P6Bz9s7T for ; Fri, 15 Feb 2019 17:58: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="rmx2bAtl"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="4VM275H1"; 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 4413xR0HjlzDqVD for ; Fri, 15 Feb 2019 17:58:03 +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="rmx2bAtl"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="4VM275H1"; 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 4413ws4YvWzDqTN for ; Fri, 15 Feb 2019 17:57:33 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6ABC421EDD; Fri, 15 Feb 2019 01:57:31 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57:31 -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=rmx2bAtleYW5LVtM DiDKDA2IuV6+FOD+slSrUyP72xye0c55rTMynUrrlDu/o8wzZm771zVsAfA/XGBx YNj8RklXqB15zd4HOBpe4SqgKmDu0Ke7OZtShl/J0oUfP+r6iExJhGpKeJ5Ubc5R TMhPQ3Hiv14BGo+hcla5BkqJUpkf4aGQcbNLlOxFmY1eVfgnYiw0PWOfYgvsq+w7 35UF8zPOHPmtK8U/X0rII7SI4vb9+Kxgv6QUZ32d4o4cIa+mAT7CBGGSLF3LLWMr HomIgfxu2rfCQdmicdW8Nr3nJ9bED9h8YeoNPMubHGAjtFUCXicC9l2Htc9t1b9P FqfYMQ== 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=4VM275H1j4wkJ6n//AQQ5DmKd8IV4MvEnMJx70XeCaSrqts2EleIdXGJf lInW0Bb0udx4PMm5gRNffyxa9b/TVkZAUYb3Dz/viAWXhEFcQmPeJOBL2hfSficf eQCpSbN8dM1LZkrAVUegfjzD5uhdC5cRUpjDK5TqAZds1yXm8k9mxq+BXSDq9FiZ 1cGLmJ3++eLzgoEWig2V1oyUY+PdAQPMmUWRmjt/r9FYpCBDxOtt/bgdoxFonEgK G6XrvGKEusAtHZ+f+9nZgzW7uRfT12+zqNZgqFOQYY3zAlG7IBhHh8cDe0rBhJ9Q 59UQJMKs6DZw6kYx1aiI1ZBk0FtNw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomh eptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegrjhdrihgurdgruheqnecu kfhppedugedrvddrkeelrdejheenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvg ifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigvpedu X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 50985E409D; Fri, 15 Feb 2019 01:57:28 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:19 +1030 Message-Id: <20190215065708.6086-3-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 02/51] 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 Fri Feb 15 06:56:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042611 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 4413yP44FQz9s4Z for ; Fri, 15 Feb 2019 17:58:53 +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="VSU2MIjr"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="SPrsSPF+"; 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 4413yP2DbHzDqTf for ; Fri, 15 Feb 2019 17:58:53 +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="VSU2MIjr"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="SPrsSPF+"; 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 4413ww4BL3zDqTL for ; Fri, 15 Feb 2019 17:57:36 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5DD85226C0; Fri, 15 Feb 2019 01:57:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57: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-type:content-transfer-encoding; s=fm2; bh= kJRzA6GQl5sUNJX55GCvImDG+yF7sC9qmrmreS1nXU0=; b=VSU2MIjrAWtfAoeZ 9O9UkljusY41hihvm8/sb55WhTYfGcMxfvan4qberUYiTtUeTeKkR+nTJT2wRifi 2PIDhFbmDu+YjJS4MyvJ1Jr7u5HNAtxOS24mc1GsOBXz/7j/6Uqy/NGT1oU4Torn flI1KmgzX8418V0ya9omMssx3vflRXHGcQqx+QUTzLzheU8iBk1oPcxQidOxXn4F KogPhO24sa2g+vbb24bRvbEsEC+oj8aB6P9ay/cv1qa8CqJD/YQyxxmvK/3HpKY9 ZPAkiQXmhvVXI6Q8cSh1OTCmF9eQpP/t0Qv1otF7BZZnwWe9ZfA/gm3CDlFHOi9F pJi/bg== 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=SPrsSPF+NZRfBYmucbQ2iCQ+DrTSouEM+qlAol5iHNm4UNFCdGCiOppUk 7ItpeoQytISDdYBysF0W/NbMaf21mVDYzkNqzyUMmGf7PAxifhmI/XUd7HQwC84V M40KqXFSTDLRQfq9hivCJHIzN9gcDDU1MQqtLcQAVo9nUPevVhvo8dSV3ICeVjtT l7yuQTHkJRcH38wyuUtGDRnE+3lvpXARtE/itotuCE9TnBB+apLvbpcYWYEv1YXy C6cLKbDZ/pSrZ4KAfWLn2cdn8YdP+Pd+XUCyYSgCr27DnXq7elfPVdBW4eAx8i9F hM9c3CTd/WzeV3442B+z4PWPqmYKw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomh eptehnughrvgifucflvghffhgvrhihuceorghnughrvgifsegrjhdrihgurdgruheqnecu kfhppedugedrvddrkeelrdejheenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvg ifsegrjhdrihgurdgruhenucevlhhushhtvghrufhiiigvpedu X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id D8B3FE4210; Fri, 15 Feb 2019 01:57:31 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:20 +1030 Message-Id: <20190215065708.6086-4-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 03/51] 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 Fri Feb 15 06:56: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: 1042612 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 4413ys6w9Lz9s7T for ; Fri, 15 Feb 2019 17:59: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="hx69vbIz"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CJMgZnTg"; 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 4413ys5hFDzDqVy for ; Fri, 15 Feb 2019 17:59: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="hx69vbIz"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CJMgZnTg"; 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 4413wz0Y8CzDqTF for ; Fri, 15 Feb 2019 17:57:39 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A83B52225D; Fri, 15 Feb 2019 01:57:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57:36 -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=hx69vbIz+EYQnPCfw7v6MCsROyG1c EQU7s2fMOFRyezQNsDzfoR9jkmEw0YgW32xyOuOs4fVZNHzFyr+y8KkBLkKgPbLv 0LWZ8ITM3ql3xvhUduboNhX9Yf0r40Ll1YtRZQ+Zi4qvuGbDPAJ05LCi/90gWxVS 2KBjjwoD4TonnkaQGsKpL+w5bKSxGH/ypOni6Z3ZAnHlrU+rJnpi6MRV83QXg1D4 ZjJDtIjWjDcDAkM9TDYozTLsfGTnPvR4hepOpPA9rlwzuNHlr9TLLdw/k17HXvOD nwSVCvsp3NL8oSR4KE4AP5+ZroOo1rozWeyRf6RLE5I7/EwDHU+/sc7+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=QZQXk4fWjO+JNrwHeyBnjDdDnD5feye61A3qcrBbcFI=; b=CJMgZnTg mRyyQshFtNeDrcn1iCe1/nHQdkQAezeZwkrnYRPRsaUGf6LMdUszK48uhlLSDnNY SArocycV4u/Y3uTX7N/2AMSYfK5bIt9f+rMvSFCzH1BgUfS74R22g/36sI1Hgx2H 8zpxuhunFQGF+MRuGQd3ZLSM1QmL6q6bliOMi3FmfvA7VPR1mt4sFxPcIq4ulVP5 The+togLgAvddF7pvvqyRtc54olFyN+/uEqZabQh3ahmYxXqPGYk6L7p07aq9Yy5 O2Rq+hurj4L3Xm5Bv8aYUTflbsLbkaNGw1Ofhd8Z1EmecEXt6J/fKxtOwOGd3/MQ hByTv9/elakOSQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id AE71DE409D; Fri, 15 Feb 2019 01:57:34 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:21 +1030 Message-Id: <20190215065708.6086-5-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 04/51] 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 Fri Feb 15 06:56: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: 1042613 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 4413zM2cqwz9s7T for ; Fri, 15 Feb 2019 17:59: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="Om0/8w3u"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="biWYTCJK"; 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 4413zM0V9VzDqVN for ; Fri, 15 Feb 2019 17:59: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="Om0/8w3u"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="biWYTCJK"; 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 4413x13n3BzDqTF for ; Fri, 15 Feb 2019 17:57:41 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 51DBC22213; Fri, 15 Feb 2019 01:57:39 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57: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=l/9k7S0Hznswn KspwUXuzDI8yHUeYIm1q2GNz+gl1Rs=; b=Om0/8w3ujXTL6Bech6QNWrLiLSv2W 078Gh8mT2x5C9jyLeE9fygStqb7kvXA4Lsc7zwDe9shcs/xyMbLjo0n4kZTLxbVR S5INU/8N+sK2UqklVOQ150Q94dxWpm3WsLEg4gBkIl4rlG9kvk92IH1jJUYI1aao 5WGybeeiT/GkU4ZJrn0xH42I/arVXv0UGjWR2LphTx+KUNfEvYKVftwlGvfH46Vb MZjMZMT1Cd8iZVZPvTwd6+RI42ISfu68oYGvcm4SoceTsr+YTuEm4w2NdwgzL8pe mVVUH+Rk1q9sOcq8mHV4CMC8sQueivtQaRrLY181HDdFuFw/7xXV1A9RQ== 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=l/9k7S0HznswnKspwUXuzDI8yHUeYIm1q2GNz+gl1Rs=; b=biWYTCJK N4x4qsx6zoBdrjAUTvdvXnB9cruVBQbNfMAAuXrnh4v3nLSC28YwDwtI1frsUjg/ gD/EWFfLpA+8SIAIjwSorxIfL3heG+jgEu2Kkoa7eAWDLxdj3yxJnYMP78DvnRLn amCMrF4y2JAFEXjSAQYo7c1K57xM2D1mIYlaupPAWaqp/UnJrGHSd0DdxM74y6aW yy2bN0NCQ15b1ZqDuVFZET4KcxiaoSnaQF4NWAVrQtOrlB+CrquptyUukvYs6miM 9z4N5ROK/h/4OaN2RaYISyuJnkU+jA+gXQdgIVH0Xai4YKWe5o8KjJFxTvdb29Qe lAyrBWCGutH9WA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 33D90E409D; Fri, 15 Feb 2019 01:57:36 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:22 +1030 Message-Id: <20190215065708.6086-6-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 05/51] 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. 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 Fri Feb 15 06:56: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: 1042614 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 4413zw0Frfz9s4Z for ; Fri, 15 Feb 2019 18:00: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="HhpOIlaM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="YfxcIWiU"; 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 4413zv5zxSzDqVM for ; Fri, 15 Feb 2019 18:00:11 +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="HhpOIlaM"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="YfxcIWiU"; 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 4413x41XRHzDqVx for ; Fri, 15 Feb 2019 17:57:44 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 03C672225D; Fri, 15 Feb 2019 01:57:42 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57:42 -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=BMdYlBSVz4/8E XHSjM1lfN1NzFED6lSCCdB8F7RUbSM=; b=HhpOIlaMB3soqht/RpNIhf8S8ibzh jVMqMNBJ6bqy09BqtyOWoqQBojHtdYcAnKs0GIMH6nNfsPborLc6i665ho9i+v+K VXiSzP+ZjDn9aWn5LyATXENu2Kk0UuuLLKtHuek1DurR6/G6KonJY/eq/xlmoAfV 5g/VvomvZaKNgiUADANKt+dFadkcjb4awfzM3w17tY9Dx44IDv+SmyOzcIa9siqF u0kyu6lRIwPOj91xMbR69SIwvjTTTWRIjrF2PltL5Q5pwJashPJs0cjiNRlNAR29 iTDetvLUZkqfc2yIzgyfCRfcGS0HKIJugMkSf8VvhvBZU0VRRO4i07feA== 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=BMdYlBSVz4/8EXHSjM1lfN1NzFED6lSCCdB8F7RUbSM=; b=YfxcIWiU /CjzipFrEUr+/3SZ1oJefyT0HfDf/6rpeFZZc76VSA7Sbtzm5ZTdET4ESswy9anu n6u889RxNGxZmUT7Yf69cVV6rSfLFBbMFvax0w2DLp4wjZFcN/eOBJEryYp3ZujS rcbp2N6Bq04UPsYvgf+cTPRAUmm1Qd4bQBKmkQ71Y0XIWW5IaRHvtwQ8vjS7cCaX Wm8t68F9U3zxzE7xeNDXoO/LiCmfRBGW1Hkx2pxAOPaMwIyqwQjardryvXg/dBEp 8Wd9PEZlAxfYGxi21yVZpy4yvdR9p4qUFnnwXaNzMU2JrEB4HDRabS6cisTMeNJP AyMwQq0p1cJtDw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvd X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id B12CFE409D; Fri, 15 Feb 2019 01:57:39 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:23 +1030 Message-Id: <20190215065708.6086-7-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 06/51] 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. 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 Fri Feb 15 06:56: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: 1042615 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 44140L70WGz9s7T for ; Fri, 15 Feb 2019 18:00:34 +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="OEuBEY/L"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="d6Ukk8N2"; 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 44140L5qsSzDqVp for ; Fri, 15 Feb 2019 18:00:34 +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="OEuBEY/L"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="d6Ukk8N2"; 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 4413x72QgRzDqVN for ; Fri, 15 Feb 2019 17:57:47 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D228A2227E; Fri, 15 Feb 2019 01:57:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57:44 -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=XJDCYdZQX/gTN Y1wewpxnY/0Fi4dznFd4jEbyDoZMT4=; b=OEuBEY/L4H9MdyjgWncW/mVK0BQpX KZ5MXGKkx3cqgNCagSvYAtaBQRAkGKcFx1Ec3FMTmEm6e7WEd6chVX75wdg6gzSQ aB2Kop+L4K0GxBbl297mkHeh8htLJ+gBlEtG4LEnslPg6OPIb/7dkR/KRYRT97A2 oaawGoTZKKnRGVcZnKh2+KERfbOsYuNkbVkJE1ufHY0kEMf6VGjnIbE4TiuAmZF3 NyXUqGrkspMxHW+/QBt9gdbHAvXEodUwNkj4cM4twxe8MlyFnoSRL2ySG2QsGG4R A8EutfxpY0GUKNjPVyR3Bbq4jXNW1JJmKnFpO3QKZEauWbmAdv7EdalRg== 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=XJDCYdZQX/gTNY1wewpxnY/0Fi4dznFd4jEbyDoZMT4=; b=d6Ukk8N2 ijhz0vyTtKO8mdJIuYo3w4jNdcO8Hkmbuuu8/rmu5pTn7GWAuB6SMZ+M8J/QL/1m AlwoByTWqyDKLhYH+r/LJxShoJy6S398mb4VMtZ2W19SvX1lRq9bYeGdpYpKNLhc rsAhjZXuuLRwiugmdBCVySk315Z1ZNGHhiDsO7dWfBxin61rZYZzcqPtWPLkDiFY UeWSMNQUeawacdkxnBzGiNXJRj5nq0RNf6OYcEiy3JIRTnSAfqogYVEBPVwtBpCE 0+b6n+rbA5EdbVT1+9si9zOxNAOJ4vUw6VFBGo39wwhwkkyDt204YycVJxD4lgKN IXAME4cMcUd9VA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvd X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 83C8EE409D; Fri, 15 Feb 2019 01:57:42 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:24 +1030 Message-Id: <20190215065708.6086-8-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 07/51] 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" 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 Fri Feb 15 06:56: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: 1042616 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 44140n1tLVz9s4Z for ; Fri, 15 Feb 2019 18:00: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="SSNfpHBo"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="BFExYxIj"; 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 44140n0gTMzDqY0 for ; Fri, 15 Feb 2019 18:00: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="SSNfpHBo"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="BFExYxIj"; 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 4413x93dsDzDqTX for ; Fri, 15 Feb 2019 17:57:49 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4A0402225D; Fri, 15 Feb 2019 01:57:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57: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=Mjh9V0t2XGz3X yP8q4nbLcIr1cGkorqALQZdQGZimOM=; b=SSNfpHBoPtBOcAF1lRF9Qi1qf0wqv 61OCaeqd7GX+T7/w/DmxTYlsRB8QsBsCJpfkI4Asd/1K6bhmeIa7a1ao4VlD8cY3 M9pg5lvJYIf8BOzJrDGSDXOaTmY6kXpKT2khXY/h7Jgn3CIIHiFK/Llvopvi/zym wVu6WbYFNAeZml75KwZSu93PnXM/5EBV71qAR1eTcipsHHGr1wMdBTNNK1kDhW6t 0G+s4af14GoTiBfIhderw0ksUyduphhNTML54CBQC3JWv4sDr6T5lyurPfxZvnz0 tgN+aVZxb2/Ubb+j0tBx/7a6pRfmeNymAuEgsd1Zl3hPmp2m8xWoZON9A== 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=Mjh9V0t2XGz3XyP8q4nbLcIr1cGkorqALQZdQGZimOM=; b=BFExYxIj Vo263wyP02svX+jzKjC+Doy9ykPZpDxx779pHgPi4RIRXHKfan3D4VgW/oDxhLSg BgTVfgrLssqFdhPtjBso4qWue33NNPFSzYMuFPXGfuq8g8Cj1kN+qZF6ciyMSGy/ r6/RfUR0ISSOQSBRURxgxoL6DmzWxER8pdIOfGkJIGZfeqmBKrfHQRUYQtiVOqPL 4Twekk+qjjiNcqO5F8fnI/BNbornvu2mp3BsJWI65BWFhrMjdSbQefHFW2NBKi8/ bOfJ2UtTUIoSnlic8TLafJlBXH1rEo7Vkgy975Pmr/QWI/yIhDP0NkPm/V9SrvYA /3Tla+938qMHAg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepge X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 31859E409D; Fri, 15 Feb 2019 01:57:44 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:25 +1030 Message-Id: <20190215065708.6086-9-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 08/51] 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" 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 Fri Feb 15 06:56: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: 1042617 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 4414165dl7z9s7T for ; Fri, 15 Feb 2019 18:01: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="lQVUt9uA"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="EGdLg2Y5"; 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 44141648ZqzDqTL for ; Fri, 15 Feb 2019 18:01: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="lQVUt9uA"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="EGdLg2Y5"; 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 4413xD5pcWzDqTF for ; Fri, 15 Feb 2019 17:57:52 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6E9492227E; Fri, 15 Feb 2019 01:57:50 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57: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=Sv1N93aXCDtF/ rp8EQBx28M6jZHP23olhCKL+Pb+BI8=; b=lQVUt9uAqc3NBvsxN1ycrYjkQ45r4 sbtxesSPNfWyRv+ngzHvk3P1b/P3fdh+rUsmblm7f5xKD2A5+n/wRGj23kA8P+K2 y/nL/YDZzGyS8PwfyGxCLhvuBuFagwflQOu0GWatR1+HP2o0c7lshx9kPwFUWt+P lDRD1B9tbV7S7vhcFlyxqw9XPQiZ39VR/CFcXkE7B7rERJNtLKdp+keTHR+HYvgd jHbSsNpCHs3RLxcdtmwXAIQSWb+K+4kYQeVCtPsQwrJdiYyL+aDQ33ot5t0VsK+N VNt5AaByzbEadkue9gMzZlErAshrhX96U/ar7nIEunCuunMdDliU//TlA== 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=Sv1N93aXCDtF/rp8EQBx28M6jZHP23olhCKL+Pb+BI8=; b=EGdLg2Y5 rmXSh1YWwixiZzN01lIKMXvb0LbOrim5oVbSNLWErCcEFfIAoasbgWT6STcl+7kL JULlycldG/3WFQoLDOWVx0WQAgL0Q8W+WtTmfu6fZwoujNXxG4JQRKCgWc9RuEjl ruEN8xZCPJqj09RjhkPvJbnpLmG14sSxcZV/EQ/Ut3m0p7KlavhXowJIocBAEq6O IUPg07dRS+GSi3oJxR6CpxkZaxwzbE1uKLqsSnweIv9DN+DpQUcJm1VI+5nXAIr/ fGUogqQoAt/PsUNVTO7+RcMbUraO7w/VoVHDDtBWzxg4M0VlhVNcC7jXbj2KozC/ toSlRhyiWkcGlw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufffkof gjfhgggfestdekredtredttdenucfhrhhomheptehnughrvgifucflvghffhgvrhihuceo rghnughrvgifsegrjhdrihgurdgruheqnecukfhppedugedrvddrkeelrdejheenucfrrg hrrghmpehmrghilhhfrhhomheprghnughrvgifsegrjhdrihgurdgruhenucevlhhushht vghrufhiiigvpeeg X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id D296FE409D; Fri, 15 Feb 2019 01:57:47 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:26 +1030 Message-Id: <20190215065708.6086-10-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 09/51] libflash/ipmi-hiomap: Improve BMC error state behaviour 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" impi_hiomap_handle_events()'s implementation contained an early-exit that was only valid for handling ackable events, but the state provided in the BMC's notification contains non-ackable state as well. Remove the early exit to ensure we don't attempt to proceed with requests that we know will fail which occur after an initial request has cleared the ackable bits (but failed to restore the window state). Include a test case to capture the desired behaviour. Cc: Vasant Hegde Signed-off-by: Andrew Jeffery Tested-by: Vasant Hegde --- libflash/ipmi-hiomap.c | 11 +---------- libflash/ipmi-hiomap.h | 1 - libflash/test/test-ipmi-hiomap.c | 33 ++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index ac47a1005ef8..3d6197541cd6 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -447,7 +447,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); } @@ -562,20 +561,12 @@ static bool ipmi_hiomap_restore_window(struct ipmi_hiomap *ctx) static int ipmi_hiomap_handle_events(struct ipmi_hiomap *ctx) { uint8_t status; - bool update; lock(&ctx->lock); status = ctx->bmc_state; - update = ctx->update; - if (update) { - ctx->bmc_state &= ~HIOMAP_E_ACK_MASK; - ctx->update = false; - } + ctx->bmc_state &= ~HIOMAP_E_ACK_MASK; unlock(&ctx->lock); - if (!update) - return 0; - if (!(status & HIOMAP_E_DAEMON_READY)) { prerror("Daemon not ready\n"); return FLASH_ERR_DEVICE_GONE; 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; }; 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 Fri Feb 15 06:56: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: 1042618 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 44141P6DYyz9s4Z for ; Fri, 15 Feb 2019 18:01:29 +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="ro142FDS"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Jn1hiLTr"; 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 44141P4gngzDqVp for ; Fri, 15 Feb 2019 18:01:29 +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="ro142FDS"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Jn1hiLTr"; 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 4413xH5GmpzDqVM for ; Fri, 15 Feb 2019 17:57:55 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8555221F24; Fri, 15 Feb 2019 01:57:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57: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=c5ccKeUmSrepM XQegQVXTC1ayMt7hGCXIoW+9SyAsPg=; b=ro142FDSzbZLGH4SbCU+S5RrQN1hm vDNCOzpQN9dRr7Kv8rNU21ypL2TAZJVPvEni0T6+ml4v+cToNfWnXtqE1Es+qBoC Qe3zTNUFUNmL7HN2NS6bYMpn5hvE+4RtVBgE1mJUx1nHDhpmFeQubYcpUrnnppSy myJ9lM1bz60xGzghbkCUBk4TZcLb8qKjq07PHbAvRPd9A0RYXOkvn1orX29YbIch X6dB6aKih5/J/ompXWmQO4noyge/DPEwdirgyafMqiIxO2UeI+2reEUCqvVZym8O FCPHp/S9Al3W+2xoEmqbVqtgAFS3whEgQTLoIXedK4jKEpQi6RXk6xu8w== 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=c5ccKeUmSrepMXQegQVXTC1ayMt7hGCXIoW+9SyAsPg=; b=Jn1hiLTr VPR71Jh8ysZ4b4/a86IM9W9b/GMxtaPR7gvnC39jkLUh4Z8eyCm/gE/nDTasrzAM onjl3Bb84v8sG91iO9I3c7xFquHvj9lvKCZWBFJA8oDzIbuX5uaWTsYSS27zWIPu yYwL8bi741toq3MOdz8bM3sij74V9RjYgrwBwe0pb/LuApFyG2l1kn3pN1XNN28U h60oUes7kQGEZdZWGgwMZxTn62UMhJPXEjBLsg6VAYPsKIOJ3uaYFJcF6GZarbD3 UKrZDhnSMDs3J8EowHiHyDmv6np8zlUriourT23Pf4K2vc6BCuXO9gGoh+1V8fAB 1g5Momo36q/Fug== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepie X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 08E85E4438; Fri, 15 Feb 2019 01:57:50 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:27 +1030 Message-Id: <20190215065708.6086-11-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 10/51] 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. Signed-off-by: Andrew Jeffery --- libflash/ipmi-hiomap.c | 308 ++++++++++++++++++++++++++--------------- 1 file changed, 198 insertions(+), 110 deletions(-) diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index 3d6197541cd6..32bd557b7c8b 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -49,30 +49,59 @@ 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) + 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; @@ -155,6 +184,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 = @@ -189,13 +219,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; @@ -205,43 +245,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; @@ -250,15 +293,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; @@ -266,21 +319,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)) @@ -288,19 +341,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; @@ -309,13 +365,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; @@ -328,32 +385,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; @@ -361,23 +422,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; @@ -386,19 +451,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; @@ -407,13 +475,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; @@ -426,17 +495,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) @@ -535,7 +606,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; @@ -543,7 +614,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 ? @@ -561,6 +632,7 @@ static bool ipmi_hiomap_restore_window(struct ipmi_hiomap *ctx) static int ipmi_hiomap_handle_events(struct ipmi_hiomap *ctx) { uint8_t status; + int rc; lock(&ctx->lock); status = ctx->bmc_state; @@ -574,10 +646,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; } } @@ -589,19 +662,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"); @@ -611,9 +687,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"); @@ -643,9 +720,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); @@ -653,8 +731,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; @@ -685,17 +766,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, @@ -703,8 +786,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; @@ -735,20 +819,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; @@ -770,9 +856,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; @@ -811,29 +897,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 Fri Feb 15 06:56: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: 1042619 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 44141h0N5qz9s4Z for ; Fri, 15 Feb 2019 18:01: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="ZellM2w1"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="omIKN2eR"; 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 44141g6Q0vzDqVS for ; Fri, 15 Feb 2019 18:01: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="ZellM2w1"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="omIKN2eR"; 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 4413xL2TNwzDqcG for ; Fri, 15 Feb 2019 17:57:58 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E31452221E; Fri, 15 Feb 2019 01:57:55 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57:55 -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=NkG0NFmMLEA/C k65CwrcGIZdQ6NMZDPSQGCSoXEgedg=; b=ZellM2w1ZAj2cDjRojFyzE0Pqpoq9 kzD/6Nh3tdUvClU6qJqnwy/SkzwQmdpf+rtQDj/1f5wh1buYplgScTtkSMr6CpSu 5rtvFz5faOvgq1aN7Z8nGPr8VCi4Ls/W4nKTJmiKVHAx9wMNGD4El+Aifq8pgcGv 9JL+z5wykHKrQNtRBaFw5ShWIenZDiU25OkOPnxll5DR3m3HN3Db3UhYyBDQosKK z1K6OLkD2SyLfmRG5Hq8hvlYDDH+fXpWAoEBMU9GRc1CPNppLpkD3H2qJjVYauss C+vtxzXppAdTwyxlV5eb+LuXbDQsWKD6waHH8dCW4cc13iYa9DFBhL01g== 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=NkG0NFmMLEA/Ck65CwrcGIZdQ6NMZDPSQGCSoXEgedg=; b=omIKN2eR eooIyVbqcQbB+SuvY8MxTGRyEMjtLe0Q19F/eGqYvQwEpM+dRUcNv21sW4dyxOtg bWijqNTIkmo4gsIni0ccU+v/2H9eklPZLqsbFnW2ON+ctN8uxIPFgfYRk5orfTlA LH4CYjRpF/ECasihTl4dyIHrvsExqbHACsk0JlkWvszEoUenL9EQm6YMZaknusqR dU0zM5B9fAIJW/gsrJvVTBDGbTT+4t+WXlXm9bImepMYGemxZYNNrImoN3d8H23R AynH58PvSY9nwIyU87o5UgPp/9RtO4qolkyRuE6n5ZziSIIq1Q9K6xhPBAj+/+bM O4maUT4vhfZKDA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepie X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id C3AADE4438; Fri, 15 Feb 2019 01:57:53 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:28 +1030 Message-Id: <20190215065708.6086-12-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 11/51] 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" 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 32bd557b7c8b..c787da4d3c88 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -201,11 +201,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 Fri Feb 15 06:56: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: 1042620 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 44141y3CdDz9s4Z for ; Fri, 15 Feb 2019 18:01:58 +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="jT57cdvq"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="zupZoEbO"; 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 44141y297MzDqVx for ; Fri, 15 Feb 2019 18:01:58 +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="jT57cdvq"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="zupZoEbO"; 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 4413xN6cZqzDqTF for ; Fri, 15 Feb 2019 17:58:00 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AAB5521EDD; Fri, 15 Feb 2019 01:57:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:57: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=pq+QY9js43DdQ XddNAU0ZiBe6z/4r2kCirVMl6sEuFk=; b=jT57cdvqzcP6gDUjqXYLMfnCtNh2/ APOLFpiE0sDo1DqzhpmGAj7rTSi0s8TklDD2iKhS1LcVZaYa/QEwITjUyc4QcUZb POY+uBnwI32qcrKd06BXLdZO6R+XLOHDiglIWJ66oJTGxFekRmBuJvr3tVlO0MyL rbwLkFKMaONvftCmR2qgJK7tY50OUlObkuVGxVk9A+eU07ollAOqQDUpRss8b0xD QB+8mV5Y4vZoMD+7ZoSVYRhNZfyeWG+FcmLtwhxKTStDqRTbN69OOVJn8lu8qHTC 9POXFJoZ3Asj+htyVUM8CPXdTtIs9wpjnOtSNAvW6b9kJ+5kBrssYKoQw== 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=pq+QY9js43DdQXddNAU0ZiBe6z/4r2kCirVMl6sEuFk=; b=zupZoEbO kqebWyGp6bqeSdBk6zd8gwX/UVzKFLb8c/MqCB4EFHcqyQprJHdENiFbxqxOy3CT WfVlzgoeFxfcih6Tc/TAYZ41ZvMMTRK5IuAk06YsVceNT0cyfqZ1IK8n+j9pPfgp Jgng3GicFXk4XTGIKr+WsDJtmXa1kus+4ai16mKzh/Wxlk04Lp3ZrOgM1V+8N7O1 feZ6wGa/rnq/q+M+p6gCCVmNfC2ARfEKO5HwKqwAngX0PZd3Kg44aYT8gP65sP5Q suC7diZcOcQnGYqj3JHtbP6mzVA6oVfJ8nSfynBd54GvWcsUoz5xZGcsWwP4nyTq zVRj480AnPopIQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepie X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 8AB37E409D; Fri, 15 Feb 2019 01:57:55 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:29 +1030 Message-Id: <20190215065708.6086-13-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 12/51] 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" 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 c787da4d3c88..86e47396efba 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -205,6 +205,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 Fri Feb 15 06:56: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: 1042621 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 44142L6d7Xz9s4Z for ; Fri, 15 Feb 2019 18:02: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="FWFV74oW"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="xdKBZZ4X"; 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 44142L58Y8zDqVM for ; Fri, 15 Feb 2019 18:02: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="FWFV74oW"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="xdKBZZ4X"; 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 4413xR64kszDqVS for ; Fri, 15 Feb 2019 17:58:03 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5BC072225D; Fri, 15 Feb 2019 01:58:01 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=ntdCUclLwyKYU 9GrU1I72WFj+Jo3xeOlQMiAcM6ddf0=; b=FWFV74oWCc5Oy9rstNB9rZazG6VBM EP49r6bAOxdYlhK1NLbH6rKs9YCn9+z0BqkJgP6Rg+MRZ6RCFID/wBDt1E3J4II1 Ng3RiCMqi7HhCct1tfpexC+o4y3aKKj2dDuWfX9j3TQnVWJAAniIt2z4GB3tn+Zd +IafRkxzmAPpKNPUhd3HwrTTKhNx8B/oRCl1rGYCf7ci6ccTMwPup5aWkU6a6lWw 478ZrPJELqMIYSpaGxSuWcxcXBtx3Pm2Vx2FG0Q4cbrd+/vOv79cre1HDReXm06T RkhMgXhnhBoZcXcY+XFm5CPPTpSvpA3hL5yWbu7gE3/2D56MSCHK45TYg== 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=ntdCUclLwyKYU9GrU1I72WFj+Jo3xeOlQMiAcM6ddf0=; b=xdKBZZ4X bWq3J1NZIKTOZq34NNHoGF/9/WYGUkvDsRwPULZ0lF6/Rb2Cca+IO7VL2XjejTE3 emuSXtlqkbS8EQu7AzjlO4p1c6AR4jx/zNAXIDc4Le1wu1HR2PexLcc90lgAAjt+ 4WKYoejOQJn/oXOfrv7ZIDqcXGD90LvM6XyL2an3nBymxhiXfH7pvtV3rMVcgJYA 4Lw9cmSFa4HW4+8k6o4o1Dj89NMrmQdO5EdV9nqSUviR+nEBWYVCXlq7N2LG7+PF UF/xF3NTjSH0KfFo6zlUbyu5AmCAyCWQWtsdPLduyi8yKgW53V25FWsScaC/D8AY 0DwYSCxQb9sRrw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgeple X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 321F5E4438; Fri, 15 Feb 2019 01:57:58 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:30 +1030 Message-Id: <20190215065708.6086-14-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 13/51] libflash/ipmi-hiomap: Don't remove acked events unless we recover 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" Whilst we send the acks to the BMC, if they are removed before the recovery is complete we may wedge the host if the error was transient. There's no harm in acking already-acked events, and we'll need to send an ack anyway if another ack-able event has occurred in the meantime. Signed-off-by: Andrew Jeffery --- libflash/ipmi-hiomap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libflash/ipmi-hiomap.c b/libflash/ipmi-hiomap.c index 86e47396efba..97d2a602af96 100644 --- a/libflash/ipmi-hiomap.c +++ b/libflash/ipmi-hiomap.c @@ -637,7 +637,6 @@ static int ipmi_hiomap_handle_events(struct ipmi_hiomap *ctx) lock(&ctx->lock); status = ctx->bmc_state; - ctx->bmc_state &= ~HIOMAP_E_ACK_MASK; unlock(&ctx->lock); if (!(status & HIOMAP_E_DAEMON_READY)) { @@ -681,6 +680,10 @@ static int ipmi_hiomap_handle_events(struct ipmi_hiomap *ctx) return rc; } + lock(&ctx->lock); + ctx->bmc_state &= ~HIOMAP_E_PROTOCOL_RESET; + unlock(&ctx->lock); + prlog(PR_INFO, "Restored window state after protocol reset\n"); return 0; } @@ -694,6 +697,10 @@ static int ipmi_hiomap_handle_events(struct ipmi_hiomap *ctx) return rc; } + lock(&ctx->lock); + ctx->bmc_state &= ~HIOMAP_E_WINDOW_RESET; + unlock(&ctx->lock); + prlog(PR_INFO, "Restored window state after window reset\n"); } From patchwork Fri Feb 15 06:56: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: 1042622 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 44142c6fmRz9s4Z for ; Fri, 15 Feb 2019 18:02: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="k86EMc71"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="WICRBoqu"; 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 44142c1YDwzDqdV for ; Fri, 15 Feb 2019 18:02: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="k86EMc71"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="WICRBoqu"; 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 4413xW18J0zDqc7 for ; Fri, 15 Feb 2019 17:58:07 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B2EDE21F24; Fri, 15 Feb 2019 01:58:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58:04 -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=wLIrIJWCSVF+O RJSH9qb7bUcgVMSvTiqnXTXyxfboYY=; b=k86EMc71h8Y0y8krpNRJ51PkP4Zh5 NZsimyBgaMvDuUdk1wWgd2+4va3CsK4gAlXW6f+aPBLDUSgmLKi2yLqx133r4p/K ypxF0Y4vqKq7mCJXB7xN7jM6uKyO7b08S+zDmIya5pP+vTDwXV+pMcPZad+Cx/W7 bsr9tQ+d3gP7jYX8GRXvFNvEPB2NUBpURStfofZtkzE+SqPu3aGUO9xQYxcQQDhI bRTeO39moc9W2vX9MOnIQoW/2Hcp6UHhs1s5GYhMHpHY9hql6JVFpbIFfOOF9VKE Ep5NdyqGtzcL8uyylkdMg7Fw9zT3prJWfWKDDR4QgRqEB1NzSA8QP6Eag== 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=wLIrIJWCSVF+ORJSH9qb7bUcgVMSvTiqnXTXyxfboYY=; b=WICRBoqu KSXTdRmo+tRtER6YLXqXRUPDN1HLy1chA5MEn4e489SXFlyuf9Y7MSLwe36xQrWR evIMOcpXWggtMBUumPrlzgxp9OLNVmG1ZW+RoqD/gkpbslSndQ0VugwU6n4hS+56 E0myLEKux5z3st4WrBGtt3TKbUJFJ1eRPrYW/tIAhxZoM2b64aoJJhD29vhqarAt tYFT8OyBCYaSBCdb46ZYEo/7T3gQoqC8hLJmFUd50ZKl9jvHbEi88aGg4OgeWqfm Po0yr1KRpJD27wU7vF/rBREb6GcwluJpZWAh9PimORCTQt1PWkHOy8InJbd4ec91 XChVnEOEYIGbBQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgeple X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id D9F98E409D; Fri, 15 Feb 2019 01:58:01 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:31 +1030 Message-Id: <20190215065708.6086-15-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 14/51] 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" 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 Fri Feb 15 06:56: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: 1042623 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 44142t5LV1z9s9G for ; Fri, 15 Feb 2019 18:02:46 +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="WjBu0t/T"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="bTcOzo/u"; 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 44142t3wlvzDqYP for ; Fri, 15 Feb 2019 18:02:46 +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="WjBu0t/T"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="bTcOzo/u"; 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 4413xY4Rn7zDqVB for ; Fri, 15 Feb 2019 17:58:09 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3F7D922694; Fri, 15 Feb 2019 01:58:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=g9tV39TR8gJkq Gs66KMEN2AjdeEwcmfW4cRMeFZJtag=; b=WjBu0t/TIIMvXkOHTMVoq72jyBd3t wnk62lpGFgpIL9H1HdUMFjuDpa/G+SgajQGTdTecD6BDpwlFhhiYIJZw0QGRzosr mlm7soldZifkiVV6TdEmKwZZN5KOtxuQ5aiE1AdCTIeKp/vwmmwCpWkEr/8oIWXL naFx7hLZzflV41U2e1VH2xzRgRzEPdb5IE2wrbwOZZYk2S0cIZq0jGQJYTPML1Xc GykIu5XP8JZixOHx5RoJUVzahzRl/RpLgLxocOu59qyAKxMYyB8gKs+IrsJGV+7+ fm8EC7/MSRBPNL/w5CNjep27NN+GYO7SIiibdRAe8TSCfE6RX9atFVQhA== 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=g9tV39TR8gJkqGs66KMEN2AjdeEwcmfW4cRMeFZJtag=; b=bTcOzo/u P/ZU3yKRfawPk+eBTg1wtsoP3dur2croAbbtaxZirr17E1lws2KTeIRbBkj+IPVj mchsa2PAAsmGHvH/ESyEY6pMblOjLTd19NsiEfdQ7+lYAArrKuMbkwY1xgLOum4H UIxozTOczNyAn+3zkOLTyID+SaYvqhLTBEaNJy4a02AFtV23VjTocB3MvZOI3o27 jcbBORF5Acsay+W+/TeMz48oGunac0Urqf2WJzBF86V6Eeee0Kf97V025V95xBkU u/whkWaFu47iJFGcDSNOPGFkISh0CRWbCljwlRSsItZhxvr905v6BSmy7mbhJ85O WElVVxcyeog5wQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepuddu X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id DCBBEE4662; Fri, 15 Feb 2019 01:58:04 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:32 +1030 Message-Id: <20190215065708.6086-16-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 15/51] 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" 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 Fri Feb 15 06:56: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: 1042624 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 44143D5wW4z9s4Z for ; Fri, 15 Feb 2019 18:03:04 +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="VY2ii2Ke"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Jvlk/E6c"; 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 44143D4t4CzDqVB for ; Fri, 15 Feb 2019 18:03:04 +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="VY2ii2Ke"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Jvlk/E6c"; 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 4413xc4LRCzDqV9 for ; Fri, 15 Feb 2019 17:58:12 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AA2F521F24; Fri, 15 Feb 2019 01:58:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=UljJDlkcg6Rbe 9oMO4+ow4Vn1PT3LTDQ5bMKsFJCsHk=; b=VY2ii2KeyMKCdSBMSPELr94higBkh H9jQN7jB0EmdYOUOGAHVidsk0UtkEsZ5mpY1L5j1pgsS2vn8q40R+PvknLBodXxS G3ar7CPPdKvOYfGMpCTSfx9Li9j2DniWAvy9dy2ea+U5tnqGHmK6jtWxq9GlYpPZ XBk8OIju24MmKx9al3Qejexx+UQ2gUNFQ1Sr4/jsaQIeqObWoro+BxpnbGjfiojC qcGD09XuahvIfvpHOKp3SbIqvMKlM0RWR3nIXhny6VNU22JtoghGofoCymZskgp3 oSpHI91W+nHTYSP6oKHuvWV2RnO8Eg+bPC9gD43O0qc8eeHEsVyg2W44A== 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=UljJDlkcg6Rbe9oMO4+ow4Vn1PT3LTDQ5bMKsFJCsHk=; b=Jvlk/E6c RyjhiKQxWWmEoL4TkWIIHqphqwygJv6JTTVqxJFuuBPLdwt8+hL8c5yVxBzmEXlo oTk6mGrPOD0FXu7/Fx3xPeBZuDKVSV0wOObmvYLz3V5LhhHzsj8+mMdYLD3p2PTx 2SsuelLk/KiYWhJP/Ax6+9wQLqZP6jJy+nKIF9DNV6dwQcfNyJTMuMYs2RSM8KYQ 0jyQyJ2CrFWrh3nxWjaOITeLgMv+EQh8TMPYDqt302c5W1LuRELQHF46GkQ36gaM g96Mnyo1fZh7sK8EwbYkFtyCl6Ubx+IHRqZ/mnsAMlKvZm3b/k708HTLAAV0Awj+ LF7b61Wz1a2JPQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepuddu X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id CAC04E45E2; Fri, 15 Feb 2019 01:58:07 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:33 +1030 Message-Id: <20190215065708.6086-17-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 16/51] 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" 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 Fri Feb 15 06:56: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: 1042625 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 44143V0Mwcz9s7T for ; Fri, 15 Feb 2019 18:03: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="YTlkqa4t"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="aF8ki8sY"; 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 44143T6RTZzDqdR for ; Fri, 15 Feb 2019 18:03: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="YTlkqa4t"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="aF8ki8sY"; 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 4413xf3RPSzDqVS for ; Fri, 15 Feb 2019 17:58:14 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3E95521EDD; Fri, 15 Feb 2019 01:58:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=RxGebkp8TJdEV czqucSOQV9Xtbjgg7eJScqKVJcjvcI=; b=YTlkqa4t3MQlNxerk6pntOoqVRUMh xDtdUCIbWjLvc79baYZSgv9j0y1yIdMRaI7PhAspZ/c0IJApGvyVpPSsESyMnqlF cQSgR8YHSE0gIuKNhJU/jG0vdiHCfAzX5n0FT1a7XIsK68qlCgr2dfMJiO9FHmZW rGdA3lX6gycwggrtsFCtuuU3VfuV58wYFaWUecHU4eiaA88Jp+no2rkRv+fKHV9I j3esZ0SbbriiOBwQmmaJxQvjbL+we7LeOMYEYiytkXZD3gezNOpd5AFAM57RJYS8 UZtXVUT+XV0CDl7TPDv5z/1Ya0Xg79dFn5awbrjqA9Ed2Ms15YzIfbspg== 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=RxGebkp8TJdEVczqucSOQV9Xtbjgg7eJScqKVJcjvcI=; b=aF8ki8sY R1HqKN+L6PWUSydCCYlKuYerxPo2kzrEyFEXz5T1+nBAjzcpyZMjj6Fk3A5xrFdf X8yjlJYmET5ji6QEejAnUStl0ShEBbbcuX4ZSrPwu2ay88kAN2y7QjBTjgN1KFsn EgoJ8WuLjarYmhr1zSZEigg428C54q8lRVxoZH5RQvxctkNllMaIbdm+Xx4yiNOb gpk/913BMNkAvu/mLJdB1cGITCEArKRbxgdKmlYbYLgiHYDn7HbIi68VoK4oO15N qiqVZEnLj2bpq2zQYLYFwbz9CHZgTvPFJUdRLSP/NL3lTO7bqRnVkkiMjGfJEnYd UiQmFyJ/jyvrCg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepudef X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 33AA8E4438; Fri, 15 Feb 2019 01:58:09 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:34 +1030 Message-Id: <20190215065708.6086-18-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 17/51] 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" 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 Fri Feb 15 06:56: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: 1042626 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 44143l3Ptlz9s4Z for ; Fri, 15 Feb 2019 18:03: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="T4oyXZ09"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="sN8qUCPi"; 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 44143l2R4VzDqdd for ; Fri, 15 Feb 2019 18:03: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="T4oyXZ09"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="sN8qUCPi"; 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 4413xj0sl0zDqW3 for ; Fri, 15 Feb 2019 17:58:17 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id E5D5B2227E; Fri, 15 Feb 2019 01:58:14 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=+qL603cAVqucb juKL8xpSoJ27QRys5bhewG6IxMX56k=; b=T4oyXZ09bgjnxdpJpsX+k1cMS6n8c HLkMxvk8Ff2j3yz3ib9mhAOndYk9GSCySJkJF/WsVdybuDH8zVITZuYkeMwAQNMc ETc8JjGp5eIp/hBuPAFnQ0V19mxCZqwzQwnafrAO5vrJElPkH0MR/0wC5OosJ7qQ XrZEvsyUFfXJuOkG7txk+wMQ2TzRqRT6sAvI7UewG8FYBiDmLco7vTXtZJnL76C3 QocMJW2KEWfEEDfRSammUbs1k+LcBUimLsSpg/fBaStr6m2iQ2ud1/mZkqqcp7z4 XnpRq2z4fRbQY2/2UCG8SK8IwjzZxUnHYtbZDZ6+xMWNLDZKiHrXMEKYg== 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=+qL603cAVqucbjuKL8xpSoJ27QRys5bhewG6IxMX56k=; b=sN8qUCPi +/18XSxCOtxF7N2GFuXs9Fz87ny6CI3j9XP0yIZ3Ft9EoAqE8kCpuU4Ve4SAcJhx lfXk6cGbq8EKIJS25VRPkKcP+8NLdzGSELjdeOp3RI2WtsI5/KyLps3kQMK644A4 sjQSxG/kr/xuk6sREPWFgykUjA276b0PZ9Hk2WkE4ny76WFjsKuHR+8qltthJ/we wtiPZZK7Mn3tzBmintUN27f0v3BbNCH/xmGLjZV+nPZDRt7c/G/zr0PwKvDl6OWL aOzRahhxEninUvgxcVfE0Wq0czGFkd2KmG9R3DPoJn6wkg/+81HWE9IPiUTqpOve o8qzpFv8WN8gcg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepudef X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id BB436E4438; Fri, 15 Feb 2019 01:58:12 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:35 +1030 Message-Id: <20190215065708.6086-19-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 18/51] 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" 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 Fri Feb 15 06:56: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: 1042627 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 44144026K1z9s4Z for ; Fri, 15 Feb 2019 18:03: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="xFtZ7W5Q"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="2Ii4MapC"; 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 441440112nzDqV9 for ; Fri, 15 Feb 2019 18:03: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="xFtZ7W5Q"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="2Ii4MapC"; 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 4413xl6PbKzDqVM for ; Fri, 15 Feb 2019 17:58:19 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4170B21EDD; Fri, 15 Feb 2019 01:58:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=kxRvibD9ZbXwO mh3w/0piHux/21XIeP2vKZmZ1i6iws=; b=xFtZ7W5QO5wNkn89cleRgS+5wIxdF l/TGVPb4O5/76hlYjgGSwkojqR/QnPiIM3xbUcDShPoI/aJ6Q2DHG6TVVevER1YD H/+LzudA6p8/waGVcW0zPOvHxOxCaURV9u0HxVCmxUiYVPI21y06PpZh7QgxmqWm xsE1fbMS3GsDGmVUlgDaBkXcNl/QhNAd/nJJ6MzV3Iope0QL8vuiFzm5Q36UDh0n D7ABgVVt2cSTjG0+ccmj3J6Hkkp2VoDJ8k9nrQQ+IHSTy+H85j82KxVES2cywD0s FQ6dM7zzTGUInZJra6fMNw5F39Zp8fQsrZAABzw+pJOv9m6T+4mdvvDSA== 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=kxRvibD9ZbXwOmh3w/0piHux/21XIeP2vKZmZ1i6iws=; b=2Ii4MapC yyjN1Uf8m3dhuUU16+WjS0OBSvnvb/ih7+Ly4iSQ1M/ed8XXp9x7EFpal3v78R3F QsMEAIRond3R1GPWUJNsE7lYjadAKcA7FajVZlnbbtv/1qFjCxg4EjstBXTGZZx2 a5qwCBtGs2Ui3OppnG2SGQp1U0CYcnPAnoDvbPBsrbeFWzJwB3njWKORkYXXi1GI v6QBN/XZ5KGxmouE97E3ny6QH4Co1T3S/fyLyOTnBQnGO8nxz/99OQ/SpXoIhXTS oOnMD8EEwOsuKtV+ciDQAGOuZD+6aE6wcqLvR6jGDvDwUb6ODdvzglb7zzkl0ZSR Rr6o6AFPA/RGvw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepudeh X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 4AAE5E4438; Fri, 15 Feb 2019 01:58:14 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:36 +1030 Message-Id: <20190215065708.6086-20-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 19/51] 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" 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 Fri Feb 15 06:56: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: 1042628 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 44144D3Gl1z9s7h for ; Fri, 15 Feb 2019 18:03:56 +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="cgtn+c/f"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="6mpDicRa"; 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 44144D1sHJzDqdZ for ; Fri, 15 Feb 2019 18:03:56 +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="cgtn+c/f"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="6mpDicRa"; 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 4413xn5bJ0zDqTX for ; Fri, 15 Feb 2019 17:58:21 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8D0BF22471; Fri, 15 Feb 2019 01:58:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=FFsrZ6absgRV2 vXcB0GIck7YcfdD5O0pJH+70Ac7Vyw=; b=cgtn+c/fLtpWq3+7f4bE6I4mlFP1H j0aUDqOX8ENyBxsz4MIR3xyZIo3uNejqgsgJaR/JOABiKRQHEFp12YdAf4D1mRMP BklJK/eeCAPJ585MmGpVKyH/Ea2HiJcRTPUThbfNkjAbmrEW6bcq+w5A3Y+2XloO Ia8RXilUEzsEvLRgeL+6jIdPVI+4U8P74lkSPeXFxgcg9C6NCt166d9fQWrsXhnM XnzD7MhgkXxeLZxrzWxD6vBQmmHwFKLO8Awqp28NxXYYq/D51GI/6AVENGw+ErLP yha57u8JOOEEt3krUh+bTKdxOWS/toogLPePr7HtsVA3Qq0UfUuVpVksA== 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=FFsrZ6absgRV2vXcB0GIck7YcfdD5O0pJH+70Ac7Vyw=; b=6mpDicRa VpR2omw7zrJTKSTyJtMY0FVlw+R0xR99Vwhacv92E2hFWmDpfHRhirxoWqzTJWTM IKeiP5J86YySLjw6P5VN9TU94gSldvksTHqNmJqopVhebNI2772ETmFVFbRVzOQk 3FgruywZg36UKciO0vLagi+m171JnDS8StXd/EQlMn6n9suXIvM40bcf3i3Fzj+V 289YE8gajmJ65x1qGrvJnF0YHACTtm3PIM3HKWbHekCQvsuA+lOENryXQqifao11 i1egAq7ZFfiouTL/lFv7gBDlM8iGnrXUqsYRdVkt+K1QYdrzbVeiur69K3vjrbBQ jRI1KC1zVHAfdg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepudeh X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 90B6EE4438; Fri, 15 Feb 2019 01:58:17 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:37 +1030 Message-Id: <20190215065708.6086-21-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 20/51] 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" 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 Fri Feb 15 06:56: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: 1042629 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 44144V53g3z9s4Z for ; Fri, 15 Feb 2019 18:04: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="DxuJh3xE"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="7Gfgu3Vo"; 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 44144V3jQBzDqdg for ; Fri, 15 Feb 2019 18:04: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="DxuJh3xE"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="7Gfgu3Vo"; 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 4413xr3qSCzDqVp for ; Fri, 15 Feb 2019 17:58:24 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 48B1B21EDD; Fri, 15 Feb 2019 01:58:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58:22 -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=v+I8RIfKJLPlc aBhAGYjiWRcIGlQUYnbcRTgVnUwc6w=; b=DxuJh3xEdgViQfYUsx0igbAbTm1xL xVBj9ZCHJuoXsMzeUEOnEAY40RX2mz7lvHRFHFcHGkA3Wnil/fg/81Jpu/P6DQYY OsrV5rgIMO18glw4snwi21iaC0ZDofVHe8UeVn+773OGjVdcRPHsfyGmeSknnwEZ hVak/H2o3tE4GLbaLsZrLI01zI0v7J6tDxrniW2bG1wU8qkWHK4mLwh30Dzp4g2O IOjSDjqUUGfmgYxcADtnIQQ6C13kOUCv62w2q/Ut/AEvyfvN0xm9ghsyVDMpj9wz aI0tSzYKmOk9xexXNGZ4ntsAgeuWGN2WrGVnERtzJrwGf3KtqTN5NKssQ== 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=v+I8RIfKJLPlcaBhAGYjiWRcIGlQUYnbcRTgVnUwc6w=; b=7Gfgu3Vo XloKEQSjsfVVsMmmpaj+0v2zzSipD/Ac7ztdwyQQ5pktjzWMK0yItVU8z8XouZCT gpElReTFDTyIPKwCxYUOrhyAAu97Pp1WdutlTNUxcukO4AjNFcT4u3+cH6oBS9/g jos8ec5L9K4XSJSgqhizSg7h/xkyosDb2RTHfW9U/ltNmJVDJQoa+gtQbHuPZ0yz oXBO1CT+BZ2isyH2/ZuSGWM27ppQC397m6/ZxH1o/TYbXfcSO/HXHEq2rN2CRTH/ b7fCoQ8KfJduoCntxaf06FVP+HT3VkyoKJpGNDaGre0oWxUHBQm1Rr5Lnn55eIys UZSHNBhTgrIQ5g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepudeh X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 15C8EE409D; Fri, 15 Feb 2019 01:58:19 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:38 +1030 Message-Id: <20190215065708.6086-22-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 21/51] 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" 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 Fri Feb 15 06:56: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: 1042630 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 44144k5C27z9s4Z for ; Fri, 15 Feb 2019 18:04: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="jozVjY2n"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="jOcsSymr"; 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 44144k3hMdzDqdT for ; Fri, 15 Feb 2019 18:04: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="jozVjY2n"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="jOcsSymr"; 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 4413xv3g5jzDqVH for ; Fri, 15 Feb 2019 17:58:27 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 002D4222F9; Fri, 15 Feb 2019 01:58:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=IyQN8VE0synqt MK00SymQ8ebeNj9ivw/NXw0vNRpLXw=; b=jozVjY2n3LjpLSMZ8JhfSZK5C/n8n RxGdUkO2pZezWGFVO5/a4BB4pP+HEJI/eX2sf34fgD/iTgKuMW/JsuFDxgUJq6r2 IZs/Gme/cs0LHy99bTHaRJSnL0/YQPPBTHqDTyCTOqODTT1ccfApgaKcdRGJdC0Z CIcLXstYa4U20B+1XpX7sxJcQHowWM6LgAPl+zflWq85rQJj11YOQVCv5XSe3PV0 hI7yRYeDN1jStL5/5Yln7ITad34tycaIKBjJE323Bp8LkfoTvoAGquFOdV0rPqYV CQ7DNSzxaThtIPgese1YGUwNYlgioEB7Ekuv9T10ee1PqE+YI+H0Jtxtw== 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=IyQN8VE0synqtMK00SymQ8ebeNj9ivw/NXw0vNRpLXw=; b=jOcsSymr sUvald6NsJD+ZZN5OFVRPLCi1GnnlEiqc9XpJ+qJ1xpt14qEaWQx+FPJXwHwlAWH AiNqK0r9gWSTs0ZjRk6FrQsuJ5dbftzDrc2iTO4o/obgeTj6keJYaNssCRsz4aG3 UQHEL5hjk+VtakJd8beu52nHm7AJ64FyE1hqaBxsgvCMEDEmOkzziSeuxqswUFgl IHZzOHQEx8vqpRVPBEOFR1wiolUoA2Y9zi4SDaZTIkewWZjOTYT6GphCIKrJLHuT A0+9EEyOhk4pECpov7c6bYH+5dACFYgrUA3RKhrFN8KoZseQiAvKL1PYwIq5/ge3 vDiJ/Z60Yu7whg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepudek X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id F1F19E409D; Fri, 15 Feb 2019 01:58:22 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:39 +1030 Message-Id: <20190215065708.6086-23-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 22/51] 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" 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 Fri Feb 15 06:56: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: 1042631 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 44144z5xwbz9s4Z for ; Fri, 15 Feb 2019 18:04: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="PlN8rv2F"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="xt9IEvL2"; 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 44144z3pw7zDqf0 for ; Fri, 15 Feb 2019 18:04: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="PlN8rv2F"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="xt9IEvL2"; 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 4413xy2B8FzDqVD for ; Fri, 15 Feb 2019 17:58:30 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D5A0321F24; Fri, 15 Feb 2019 01:58:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58:27 -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=NQzGC1GIr9chq uOqlrh9YPxX7vBh5NK/nPG5MVZfty4=; b=PlN8rv2Fy9akzBEmuYiDQPQ9+y654 qTb97etZQSsTjJUDsOj4hlBBbWg+DveVCJ7SqhBNlbPlpMduyFybEKD2v4RtFXgg 5pRgloCo1DsKbedUissAzQu/0PQrQfUP5rlJRRcRr22Pg/WZ5SIK2eUpbqkcPR4c fpFafqCtTiX2mHNOs1UhghWUkzatk+rgqoiMtx1gELGlqCLvtedtyICSu7o3Ft8j sYdgO6SViGoRJx5kNqDhr42POgDbHe7klukRMlQ1JmnycySyell74vY7qWe5n6qS bUiqoFFLzAsU2aCP0xYVBfewyrLR5dqP7MM1yv9DWtHQNk1gC4WNE9HVA== 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=NQzGC1GIr9chquOqlrh9YPxX7vBh5NK/nPG5MVZfty4=; b=xt9IEvL2 ZCdk8ssIdgGLP/GhtLjNijwFuiA7wehQglR4hGM7QONXgw2jSI5cCd1dSrZV2ouU Lk3pOlU24XAmWAx/2VTDhFVIseZgxTUe/bZKd6cx2cHPtBf0Wq3hQV7BE3QJCKqd 2pAZjqiS5Rc+knCn+sSQfXyklrBxwO8TEu0MonAeEkkfONm+RCbvP4HUCuB974Bw pPI7wCE+iGfRk7RDQsy87SnkuwCP/qRbAGGAyxyAuv5jijGE1yPa9NHsrUXok7Kl Hg8TPvddmn33lNbp/OM3V0NHwQ/Ew9mISM0cxoOlinyoCb/9TrBIFZA1PHoo/t8n rO1MS/b+caNXPQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepudek X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 73A2CE4438; Fri, 15 Feb 2019 01:58:25 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:40 +1030 Message-Id: <20190215065708.6086-24-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 23/51] 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" 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 Fri Feb 15 06:56: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: 1042632 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 44145D3X8Jz9s4Z for ; Fri, 15 Feb 2019 18:04:48 +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="XpNRcy/S"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="giu1VKZu"; 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 44145D2PQWzDqdt for ; Fri, 15 Feb 2019 18:04: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="XpNRcy/S"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="giu1VKZu"; 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 4413y033pqzDqVN for ; Fri, 15 Feb 2019 17:58:32 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3456F22245; Fri, 15 Feb 2019 01:58:30 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=+Nw26jNBujqLx lfx5BSOyIbx5S0m60cVHyZT4Zka/JY=; b=XpNRcy/SwecvWsDyHCPoFY2wMlAW1 dFzaXN7Og9LF9Q1XiwKRKuG+Mal0gAG7r2MSizu5kOSZuK2CIQs2tX06EpfDkS5u dlWNNx+C67NdQGv9cC2oZAoo6oira6sEz5LLUANU6USRZdssLCVQIaYF6i9S5u5M fvyhvlhK7EGVX5DR9Tyri8X8sTstt7GIL+m3XRXQrQDcdc1GOuHFR7TdMBizk8Zt YgqN7q2HNlLaXao+L6R/7taoJcveyL2v5HDPygSi5XEsXt5Ui0egkFqeSTrETktj VL5HvWvI1x4uev4DL3/0fnbESSui+9TT9ay2Ri/s9NyHmQbmiCC2nz6Ow== 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=+Nw26jNBujqLxlfx5BSOyIbx5S0m60cVHyZT4Zka/JY=; b=giu1VKZu kxP9jNFHHVsPTsLzp69OkJ8Bb5edRpr7mwztTrr9oNlxaYtEHPzduFc+3o7A5e5L Gxf8zmMcQoJOqMaAEIlt7OPQhAf5KY2HBeJaGljsTlvMBEZrkLtf3E7SNsOLT3ob 6TfluXTRcZ+9Pu5FsyEPI/TMLjk4JqF9rCbmCkiVFcqHmYlP5HxR5hDer+ssduFn mE3Uijt/tKoY9x9hZMBm0c24EaQCAbjr/siaOQRhChdHbtVqXzLl5pti4YqHxDGH yguVBYBxqavNKN74K8lsml6sYFc+ADO/E4u4lu3x+R6LV473G95ULaFAWaRmG0j+ 57zrpHj3vg7lhw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvddt X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 4BF4EE4210; Fri, 15 Feb 2019 01:58:27 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:41 +1030 Message-Id: <20190215065708.6086-25-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 24/51] 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" 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 Fri Feb 15 06:56: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: 1042633 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 44145S721dz9s7T for ; Fri, 15 Feb 2019 18:05: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="I6KVUTzr"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="PO1BBCHk"; 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 44145S5j23zDqdw for ; Fri, 15 Feb 2019 18:05:00 +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="I6KVUTzr"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="PO1BBCHk"; 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 4413y323PbzDqVD for ; Fri, 15 Feb 2019 17:58:35 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 11AFB21F24; Fri, 15 Feb 2019 01:58:33 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58:33 -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=4u4d5d180uDZa e6O8h6gSijeyaXewZ43/7ywI287l5Y=; b=I6KVUTzr6g2Dj2jOixUZB2BkVZRgW M36Eq71ziNMYD4TVbFok48Y3aHj+oAF+s8ErYfOhOLPQTa7ZKqm9zP7lp5pGKRdI 1LdTDre8jJOHz28X0Y/2qsVjm/6+glVgefyZU7CN4mFVP+NxG3RdFSrwwWRS4udi eJqwcd6ZF6xfbrgtx9WqjWgnzSS3UmI/SodJhP1WtoorkN7q8BFo2F97h+vbIwxA A8/PR4D07ibXdZJSzyhCwQrHubzjgDMoHvEKpud4EBlBxfyXZkVjvZ/g2T8HgkFT J7FNU9tMhOS43D05jpW93Z9UGnA3aG95pAOESWFETj1ZCD4/FeE+B4pow== 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=4u4d5d180uDZae6O8h6gSijeyaXewZ43/7ywI287l5Y=; b=PO1BBCHk ZSpe20c0wFJOixzdpDqO4ONaNOAFPNNXys/xmcP6gqceHC8VLjhmk+tArTN7DWUb W0uCWQLhSpIECQBjM0WVYAwvbZe6ioEJ5zAZtQ905SnV/jAYLW9nz1zsBWmTeAsX R7qn1uAe7xz1OroICb2LsXdj3rG+NOLD1NE59S9Mqiv+bp0+mPbGRC2MXpyr/8TK tWsSAY0hKJUQZrvWwx5TBzC0w2hXKwh1BqpmbhNBiGXzSBqVMxjsobfFxickOpmO VoSuWkk2YsPCoLPqowxWik3xmyL1qAneg2rsLOB1OYgWvj2rVOAoCh+AZCVFKSZW jzjYng1mKpZ6MA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvddt X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id EC849E409D; Fri, 15 Feb 2019 01:58:30 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:42 +1030 Message-Id: <20190215065708.6086-26-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 25/51] 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" 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 Fri Feb 15 06:56: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: 1042634 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 44145k45Mtz9s7h for ; Fri, 15 Feb 2019 18:05: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="kqDl1udk"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nnrA6G/2"; 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 44145k2ybMzDqdS for ; Fri, 15 Feb 2019 18:05: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="kqDl1udk"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="nnrA6G/2"; 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 4413y61QjkzDqW7 for ; Fri, 15 Feb 2019 17:58:38 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 639AB22245; Fri, 15 Feb 2019 01:58:35 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=xEoiT4ZXhPFvW i9dbpqz1JOGtaD5qAqx+HfD/qxqOTk=; b=kqDl1udk9nSoczDCZ58jLVIpx97N1 fNEj1MP0YkkFmoDt6TW/0EmzoyizqI8rYdArReh/3GX/W13HmWO9KJ3cGIo0wB7p b+U2Cl65wi02Nsp4enWlire4M+EQq13fiF8Ip4u9ABdFgIBmfuchVs6zQlj6zIyF uC23koiwzrfyxESSD8tZWPmHOsBkwyqvBVBeqIMCqY7Ig76FX6jtYpOJzPgoZGYt ID0AMbUITnvFn30BM7+Sonjl4JGoq2EhQPgIkvDkcrWFB4qRlOXu8FmPN5aqsC6Z AqrAMMFF7XDxzJbCGnOds9iTh8GQvCxbuDUhFDoOJ+wDrEnBja7UU+xyg== 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=xEoiT4ZXhPFvWi9dbpqz1JOGtaD5qAqx+HfD/qxqOTk=; b=nnrA6G/2 DOklkvYeJapAIE0OdcLeoPvLfY0u+TwRPVxe7AoUXMX/G/6ZIMAZNzvWZifVPjrx kau2YWRPjniHpsG8MnlYRgk/Rcp2tE6VSaQD2dzEOh1Hkuxb9ga6iJBxgo8Vkkr/ mb2x1InXf9qOjP+8Ve0m5OG8MgsLF/odo555ZmuHOYhKaCTQ6Bhj7pnPwTuOD7IT yU4X73gqq/1wD00j49BtGOKw5dFSLAfVtUWmnwpa4ci7hDMkM3MfItUyYS54xcpv Qhgl12TrNa/On7llsvo5Oi4OOqZ3G94TbLqOFKVIdx3yk8dhyNQ7DRmq+aZ6AcRj LqQFHIdboE+BQg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvddv X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 51B6AE4210; Fri, 15 Feb 2019 01:58:33 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:43 +1030 Message-Id: <20190215065708.6086-27-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 26/51] 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" 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 Fri Feb 15 06:56: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: 1042635 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 4414616qWXz9s4Z for ; Fri, 15 Feb 2019 18:05:29 +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="cPkFMSU0"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="JU7jjZxl"; 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 4414615nthzDqTg for ; Fri, 15 Feb 2019 18:05:29 +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="cPkFMSU0"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="JU7jjZxl"; 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 4413y76sVczDqTL for ; Fri, 15 Feb 2019 17:58:39 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8FA8521F24; Fri, 15 Feb 2019 01:58:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=QzLWbeq6Y1elh u0o3BG83EPy8wLIkgooSEjgUnk6jOA=; b=cPkFMSU0Z8wtEYIsB1sOE3XfONWO9 kLVwO+mZ+b+BPW08AMaBejky/EWY9XIwztmflDP950MtmSOz592FFmMFwjC0aPkS SfHnOlR9+HBg8uyyMqfC+FN9Ge6PlmSUzT6TsrGi+3Q4dlXB+xkMFTBjlwbSVfCa 9j59A1UaUougax1m0aoOT0alIF2q3b7b2O0Tu9u5V1aM0TbCIdjchA1GwNFDtXtz 428vTM95NtxAxD8YmKuo64Wr5SexJ6t1BS6xnvFu+fb7ZA2V4YoKxAxnN+rv2lhK NhimXc8snwefOpk1+X+jBUiBvQUXHmhyiNIql89uhmBkMsSPQiHwBuqVw== 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=QzLWbeq6Y1elhu0o3BG83EPy8wLIkgooSEjgUnk6jOA=; b=JU7jjZxl tYmFG2m28e8UOas0q2EIWe40/KAWyNLgFL8qwenV6Yac0g30hAYM4v/3bEokxTMB wlKxLdRu3CoaZKCsjLMPeNjuDMAiFCo3+BUorZ0PKN/XCWOmrg78jG7J9AW7FQ8v EZI53QLP6dSXamn/Pkbcmj8k3Gt7vjzvztSDGUuQ257HkrEIrCuq9FqqH6xXJgI/ 1uwEESWNdi90LMTYHk7wrb8JtoZ0odjvQvzd7koIg0OFx6s+EoZqkFOhq8/LPxIu m3BbJK5+gBGWUvcux/ajwQuqaYeK0uvUjyIPDjGulNQ6akYbqyrV23iXVe8pMRY9 GS6cH7d38RYLUg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvddv X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id A6F26E4210; Fri, 15 Feb 2019 01:58:35 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:44 +1030 Message-Id: <20190215065708.6086-28-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 27/51] 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" 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 Fri Feb 15 06:56: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: 1042636 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 44146Q2hycz9s4Z for ; Fri, 15 Feb 2019 18:05: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="rxQSgrco"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="eMBd9RfS"; 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 44146Q0cRyzDqTY for ; Fri, 15 Feb 2019 18:05:50 +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="rxQSgrco"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="eMBd9RfS"; 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 4413yB4kttzDqVN for ; Fri, 15 Feb 2019 17:58:42 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0840B21EDD; Fri, 15 Feb 2019 01:58:40 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58:40 -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=8Nlf7Comnxydp VjFaCEFgVE47Yb6dbzBdTc9BPEtLrg=; b=rxQSgrco9dP2ptFUN8S55b9cCKtOy bgocpYlNY5Vr63RtksHIdY15JiW8vS7kAYHZoYoksWpgMXjmjZ1/FltaBH3OHJf0 cZvyWiKccYvdVuy+0CS9tm0YozOrgiVe7xwk/hOUp4uGGWY5SnpIXguBML3GSALg LX/k6v3aofRxxwExSYeyR73G237LRnSPWdQAgPrtB+im8LZZIt1zGpcHv80lyHYy jYvvNf4W0+QBV6mso93GhLkO3spwL7Vf75+L4XXTVN/3VtfBzQwNlo1vgK143ZEY wxHb2KOoZaguCklgqkF4MQKrjql2LUJxuWyuQtah8mgBHoq5btuWZ0eDA== 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=8Nlf7ComnxydpVjFaCEFgVE47Yb6dbzBdTc9BPEtLrg=; b=eMBd9RfS ayDDQKbt543dI+GLIOgZNibUB8vfatCtUuAZgEW1ywjiSGiOe3K+1z3XG03AneFf irrE9P3M5YvluRP6hO3MN3QgCwtoPWrEBPUCC2FvLdGMIzKqv3q1tv/7R/P3kAtY X5WcrbNiZBlWb+HdTVStsJf47nG3TPR6QoYzLO5rB9tHDgZ77jKmw0PqoQVY4WbD yzyF4LH77cGxp+TwOjUpKWUUGIoJJOU0uMwWNOnmjja8NWsMIDYi5ZZTcpsOdBQW 0tSrNqwwqiaMc3JD4Su33BsxrhWJbnynhPWSj/OErOX2mFHZOvINjzMMvbY10vub 9Pw+PvEneyNLxw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvddv X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 1D748E4210; Fri, 15 Feb 2019 01:58:37 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:45 +1030 Message-Id: <20190215065708.6086-29-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 28/51] 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" 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 Fri Feb 15 06:56: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: 1042637 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 44146j4RGmz9s7h for ; Fri, 15 Feb 2019 18:06:05 +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="ZbUqVwWS"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="OxcKGU3S"; 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 44146j3MbjzDqfy for ; Fri, 15 Feb 2019 18:06:05 +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="ZbUqVwWS"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="OxcKGU3S"; 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 4413yF1td9zDqVB for ; Fri, 15 Feb 2019 17:58:45 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 12ADD22245; Fri, 15 Feb 2019 01:58:43 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=uqG+p6PfndyS3 hnHqsNDiY2yqEyh5BcBI7/3rmD6wD8=; b=ZbUqVwWSBJK9p8r4m4k3o+fAVKfyH WYXZPxUySFM1JX47JP8fOETLZriAYtXrQXnJ0iOUQXEpNgEaoLkUIraNVn4SQg80 s4WDRYvzAixiyf3h7kNlueBNdt8xbWCbF71vGVDU4k1MeyAC9gkdOw+m5S+gb6NG 91heTO63fWdl2Tfo0+sKBdGK4yQjtzYLPSx4hsDXJdMLcLYQioXJJwWn1u3f+6Uf qFJxX2gblI3svc9ufOJxPlOp3po94l+G+LP+tGJ5ygl195MvGiP5Uk4o71K2wDpK GYJ+au9PGM7jTiJtiVeN6Wo/Rb5bpEcR0oe7+TZqA7R8EZep7uoSpn0Tg== 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=uqG+p6PfndyS3hnHqsNDiY2yqEyh5BcBI7/3rmD6wD8=; b=OxcKGU3S qnJN0hBaGfN/dBhOLOhFF6dVyflr1C0JctGqzPjz35EMZz/VFxYl2EtnOO9iGRDL OO9AkLnEZrryN7OGy4W0GkHfYnhs52kLieaXXyw2oNxTAmkVKi8tNly3iuhLnZSS eHf791m7vkutoH9JGLS7EBkear+NhuYGx4tLMLxjlLVDew1WFAFmI3FLsWqczvkX RyX3W4wh0j6b6AUO4EV4UMQEKl7GF6fdarLlmsgPQ/Bcvyx+zgxl4s1891Z3xFTE kXI2Y38davosPOGaOA7ntSXlfCkLtHZPhmKh4ChEg8p8mLhLE1L2svD7NShpdOBD p/XpQk05dr/b5Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvdeh X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 8BB4CE409D; Fri, 15 Feb 2019 01:58:40 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:46 +1030 Message-Id: <20190215065708.6086-30-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 29/51] 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" 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 Fri Feb 15 06:56: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: 1042638 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 44146y1jSXz9s7T for ; Fri, 15 Feb 2019 18:06: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="BjAJCYbP"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ECFYgQCu"; 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 44146y0VDnzDqBm for ; Fri, 15 Feb 2019 18:06: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="BjAJCYbP"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ECFYgQCu"; 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 4413yH4QCxzDqVp for ; Fri, 15 Feb 2019 17:58:47 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3CD4F21F24; Fri, 15 Feb 2019 01:58:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=erJgiV+24q2us lNH6G584P2rYrsIUg2YhYnwNaBz4ac=; b=BjAJCYbPscbuHm3GJP4EwrDKyelTD 4Y/V3SzCfuXG9sSR3trgRyo/q4R9ZWr4iVICIuzjBAnjtK50hX3ZyekOE2mnarLi iGY/ManLqVnri9+AlPwdFs1WJDudjAc/F/ohYM9xsEJAE8rvpJYZQd87xSQwtkI/ KngG2LrJrSSQ+bwKlGJLB4uhzT0hCIp0B77oO3nAQmxz9vF+h+U/VW3RIZ60QZOP ffKWfh6W97Y9VdZV9g+UWvd2WR44YFacQOzy0n96HxyCqDhUqv2M9L72EBjPMdgn MLxkNOnADwh6LFvzC47c620yavq03hXy4IqpO5hKpGYZEBuqdmweeAfLA== 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=erJgiV+24q2uslNH6G584P2rYrsIUg2YhYnwNaBz4ac=; b=ECFYgQCu hyVukm/dfIpRDteuGDUua//bdYrfqwmH3MMr2liqzfa0+mY7nv/2sCKbFYNiFw5J y69bdoQFhaHwDSpRTdq45BEOz2KJ/lNflqfWBxcp/Gx+BtwBIhFFffBW6YfDHa0V 42n4DKDtsFufzMDgFTaBDCOByvz233vtrjfWUBlpO4HKcg+myvAmSbnIejVl9UZ5 1exl3wxrUCuxHIxe39TGbVngUu3hh4dLivZLRX6NHxYvT/E+wzxgMiuXhijhIer9 r5cIkNRYPSccAkFHmEBVvSkbVaeFd7U7tdxGZfmiv5BKXZ9uE1Zwj2H6QP8ktJTO 4Ze0+OsXj2FYQA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvdeh X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id E9319E4596; Fri, 15 Feb 2019 01:58:42 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:47 +1030 Message-Id: <20190215065708.6086-31-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 30/51] 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" 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 Fri Feb 15 06:56: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: 1042639 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 44147F4KXKz9s7h for ; Fri, 15 Feb 2019 18:06: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="bR5TRM6Q"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="I3/XMVMx"; 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 44147F2p69zDqkG for ; Fri, 15 Feb 2019 18:06: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="bR5TRM6Q"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="I3/XMVMx"; 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 4413yK5L8PzDqV9 for ; Fri, 15 Feb 2019 17:58:49 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 89056222F9; Fri, 15 Feb 2019 01:58:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=srCbexLy829zM /QKAkYn6Zrh9OT4p2yERq7p+BbOf40=; b=bR5TRM6QS75n+thR8EW3E1+ToMK6O pWD5zXTTn36qMw3ROpCheWhUsye3GDFVit/KiwFB/Zkw/LEik7OzJj8TK9ZDj0xj AmzkfGMNxeuaAkPQ5WE/k2unwsJPaZ7dCLITvUPdPXvqieYx0KyBOaTA6AU9eAVl 0b1MzI52QJfqXx8CoYwASyftjglX58K32u4L12fhrZ6nmhK9cVCokXb/T8aFoqxI 5otgAeB5cwJ5nlJRX89CmCpAHlFJKzbaKgG5G3Evj6NYQ+3K7HaH74qzF892lPwY D4ieqNL7bfZxNhhZrqRl51BZ32uGqP/Pv9Y3CL1uX8BAL4sFGLAC6sYUQ== 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=srCbexLy829zM/QKAkYn6Zrh9OT4p2yERq7p+BbOf40=; b=I3/XMVMx alv9wm+ZvgbndqRNsPjLUISvxdE85eva9gz+EfzCg0vKB8IYmBGAR2QFqV+LXTun QJHZx9QGbfsEVLKkd+c8cNIp5LF+2b0n/0CpNaqxL6m+R4VCOScL5sf4H4DSq14h a/uj3QwHG5Dgsqsv/2VajPEEHBNXHokzqET4dT54SSYxQPIxpjc0kV9OfIHcbKkB 8V3X0h1CVxMt/wNUXqnnztmcXk/99RjxGmuHgKitpBcPPG4hAcELTwpK7u7c59xE U2RMocaMT7NFls3hunAUpCAmJG2b4+c5zQlM9SVE9e8bBgFqS/ZAgUXK914010v/ yzYusvdi1hdPTA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvdej X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 4B7FBE4438; Fri, 15 Feb 2019 01:58:45 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:48 +1030 Message-Id: <20190215065708.6086-32-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 31/51] 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" 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 Fri Feb 15 06:56: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: 1042640 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 44147W6Y3Mz9s4Z for ; Fri, 15 Feb 2019 18:06:47 +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="vhCNPLve"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="UpE3Fkl2"; 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 44147W5XtPzDqHR for ; Fri, 15 Feb 2019 18:06:47 +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="vhCNPLve"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="UpE3Fkl2"; 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 4413yN19NczDqTf for ; Fri, 15 Feb 2019 17:58:52 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id ECB4321EDD; Fri, 15 Feb 2019 01:58:49 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=QiXjheqEsylAf ujmmADn95bjm1FqGpugm2gV5LHEMRQ=; b=vhCNPLve2GiDGz9+Fwsg2FD+3mhEf 8u7kZTYhY4Z2wAD38VkCd5XNSx5Eyna7qwrpB57QCLR7IMwwkiP/Mz9k9MMi3o/6 Ql2QBsDqs+Big8T1w1P/HZHJ53B+3c5foCGD6P2mRj8s019UP7k81L9dfsIR26rN XG6wMGmX8Qw4QIGT/UkUgltOidx5LOtTLOwiTnxvbTDUFplcwtfc/QBu1X6U2y1R lJZXr+M2P3S95nVQLn9DhX8v+O9FTaUCYe8NJA7AYrqSJVcBBQ69u3ZUyCjWiNLk YPvUJh+j38lfTJLBvlI3WYOlTbcvjJ8nwEXpLHPBsR9KrdPFffDJSVBcg== 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=QiXjheqEsylAfujmmADn95bjm1FqGpugm2gV5LHEMRQ=; b=UpE3Fkl2 D1EtLVxDxSXFLYWP9SSK1MTpf030JeMWyy1tvxJE9X8c06dOvLOM0MPPP5Xc1oDx rCPWfZrx9w48ZZFpKIAEbvqUOlnSNlxcscWV/ZDgIyU1tg/RoMrJtoFpUmVztzM1 Mrnvzz0kEN5+JkHGsMtOsbScsyCWyzRubpcWuvS52I0eeUDEIAGsSJzMLGiy3ADT PkpZVtyIr6dMWlOMqhE7mMAmUnodaMNx9Adp3y7On3ElRIs/H7KCYrEVwnSDLNru UTRsuZLo3I8qti0j82IZAOvsCZWy6MLn9x/y8IjZIWhX8YtXGICKnECGo5BmklAX eZYf6zf5vyZYCw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvdej X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 121B7E4596; Fri, 15 Feb 2019 01:58:47 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:49 +1030 Message-Id: <20190215065708.6086-33-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 32/51] 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" 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 Fri Feb 15 06:56: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: 1042641 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 44147n66Xpz9s4Z for ; Fri, 15 Feb 2019 18:07: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="XeyZdEWY"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="NuXDME7C"; 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 44147n55HZzDqmR for ; Fri, 15 Feb 2019 18:07: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="XeyZdEWY"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="NuXDME7C"; 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 4413yQ5NFyzDqTL for ; Fri, 15 Feb 2019 17:58:54 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 89FF421F24; Fri, 15 Feb 2019 01:58:52 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=1Ws0MOv5uNTZQ J8wBwhFdYopvNdyeRGivetkG7j+XWw=; b=XeyZdEWY0SrMaPGU3Q7ZqbuITeQbV VXJ960lsuZ9z083GYs4w2kNWCNG4/xxGNRM7uN+AMXu+86S1Q/xL/3QPTPQgQtJt 5FWpVUuZ7FqcucXl4LoltTxEWxKZqu3cSITiOIgBPWAUlhqf1N+4Y2UXrwrqQxE/ lyDKhycqh+0u+qlcKd0xpe+YUF7dKWA8iWLt0KeL7K8BmWBt0qWzY0ei0BA8MshF BSLGVmVwUHGLOkm6t+tynvrSlHuKYQoJkkrac4S/gAYOis6oyJN78t6N1wV/OX4V Bwr9Ce5c0Q8kcrVrzL153BppnXDQ/jKRjQPFwqCq1sHAG4XzYnfmfHRUg== 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=1Ws0MOv5uNTZQJ8wBwhFdYopvNdyeRGivetkG7j+XWw=; b=NuXDME7C Xf3IuxDe157N16IkK8ZAF2dNZ2rbzW0f3A2ssP6Up9r64OiqSeN6vUFEPtN/VEvy v0WyOViLapzM2Oo71p7kNeCMtblj+SFlp3KgbUpxkcQ5zvFBxw44kPrLLzUqQbjK s/r3mcVsq7a2Ikspeb4mXSMxFW5EUOJk5J+YaPFltPrdxOpDjmB3FFTVy6bdM6sp i2F4AbNjfgf3Tp+n8Yfd9uaqzxIgP6C+2uqn55v8lyJgcErH3RJN5phh4KZtCTk/ 8pWM0rW290UPKBW9P6B8xPGv6rJu4N8N92YdAcMO1d97XgWG/MYzjmlzaGwBvStv wT56BkIm/P9W4A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvdej X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 81EA9E409D; Fri, 15 Feb 2019 01:58:49 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:50 +1030 Message-Id: <20190215065708.6086-34-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 33/51] 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" 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 Fri Feb 15 06:56: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: 1042642 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 4414833Zqtz9s4Z for ; Fri, 15 Feb 2019 18:07: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="f27mxHYc"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="k44YkFtH"; 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 4414832bTRzDqpJ for ; Fri, 15 Feb 2019 18:07: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="f27mxHYc"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="k44YkFtH"; 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 4413yT3FjdzDqVN for ; Fri, 15 Feb 2019 17:58:57 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 174B12225D; Fri, 15 Feb 2019 01:58:55 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58:55 -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=opzEiVOnlQOJ1 oRWOr1ql0vZZaRSk91HtpMWaxsRDTw=; b=f27mxHYcJ26RC1umgLEvfSCJ2eJ0G +97VAGHvYPWAgtbmXdixpfTOgYMAnD5E6oMeh28fFxPhABl0C3pgs/Sznm+kx3d8 sWd3He4LQSkQH5IHBcFTRpneAYdoXXctxx804BryV/ZMk2D97Fu4dlDN5o7Ou9mk wiooqVgHO5L1xNl+rXe6LIOFv1i8hXvmnBx/jvwjAGnHJDIvLNyZMHikmcDcVErx MCzTJD0hYxcVC8hZtu4aKpt/qFWRNLORUOvZhW/Ran+FWAejrjt/Dv17PMfgaNY4 Ozrvq8btevhkrO7j2WllL2YfGt8jX0tXBZl44tWrSqHPWFocvtJG/cndg== 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=opzEiVOnlQOJ1oRWOr1ql0vZZaRSk91HtpMWaxsRDTw=; b=k44YkFtH hZLeCOC+UILXIpPkDeq8wyKAOR1yMqZDowyLgtsanrzlxFLDEw+JSGjE0SgbhyBh 8kwSaZuJZG1+Wes5ZICRRnlgIKxanxrMLGDWUlQ4I0LnnHG7e9qZfaqntjtg7zwm JtIqhNeJ6t1GZ4uzK359/mBXIMmz4Py/6HJEI2K+YSHsEPCP23B/LQsYMygxVeN6 PtYmNzTzknDgY8vnTVkffHLUW0XFiQvV00a/lq0ZbY5xbE+DZt+iPNxLM/Qx74js PyXBZJ4BxSVwxZLTT4x6MXP0+NJ/Zlzjg7GsSbeni8qFmlOhAhqDeboPuEZNzHQr Nd0SEjm4SfNqSQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepfedt X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 2F66EE409D; Fri, 15 Feb 2019 01:58:52 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:51 +1030 Message-Id: <20190215065708.6086-35-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 34/51] 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" 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 Fri Feb 15 06:56:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042643 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 44148H1bDRz9s4Z for ; Fri, 15 Feb 2019 18:07: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="GlHksX28"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="jLFIbbw7"; 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 44148G70WQzDqrV for ; Fri, 15 Feb 2019 18:07:26 +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="GlHksX28"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="jLFIbbw7"; 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 4413yW5JCzzDqV4 for ; Fri, 15 Feb 2019 17:58:59 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 35CA1222F9; Fri, 15 Feb 2019 01:58:57 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58:57 -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=Zl7EFSSJhV1fN 5YQ2IyYRD37qR8Eb/Z7KIjQRjdV6CM=; b=GlHksX28svnByFFEtIiNncKTww0DY ae+IzBEBqVTR70YUyIst8xLZ8POV3sH3+Ge+O52aLEI+z1OqEynq0olmJSArpPif k5tEaLnSCcalkYhaOuOiBVtPEkK6H6cJme3KyfDOtldayKzSiqipJ5xV75ntb42l 73KB+v1cHaGvA1i53QDTSzLfnCQKG/ArHP02G1ASlgd7wwFo5K+xDnUdjwcP00L+ +eHXukpjYmOX7DZqBa8NvbD3wY4tN4zPm6KmKhzC/dTPjLychRaLLEVZHsa/4NLW sWY8icvjdX9Mt+nnDkdfrSVs3+wpz6/1ZXDYIbOQcgpWkanHPcpC4nKQA== 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=Zl7EFSSJhV1fN5YQ2IyYRD37qR8Eb/Z7KIjQRjdV6CM=; b=jLFIbbw7 bJ8ui8hPaWZVJ50+FqnVeC5/8mXmNFJIT+nqSZIgOg5jsLlbdmiJo0k2fkGT27Dn lJMa1/cfKWrOXSnT0jwb6V/J2NQlX1gxm6xBTY7lFz9F2UeQDnLsIz8TnBwTr0d1 lTOQzv8jLHAsV5M74uDmkXqvdkedzZ72Whd0Uy/YwGfQR8IGeFSJdWuj5W7OAaCU jPjRoy6x7z22WF2vBhUoQSYzGoz54o4FTSQE8WQW5W+hMxIC7HZFEqSpWWbVOWOC swwTCtfnaUqiVifkUP+haJcftsAesQatnlO08awr5d+j/xb30iAb+oXFfHe7rUIX Rs84hmYfRnJZcA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepfedt X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 541D3E409D; Fri, 15 Feb 2019 01:58:55 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:52 +1030 Message-Id: <20190215065708.6086-36-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 35/51] 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" 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 Fri Feb 15 06:56:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042644 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 44148Y5lvHz9s4Z for ; Fri, 15 Feb 2019 18:07: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="Ba7OE4fY"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="N2DXDwPk"; 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 44148Y4mQVzDqsD for ; Fri, 15 Feb 2019 18:07: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="Ba7OE4fY"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="N2DXDwPk"; 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 4413yZ74jwzDqTX for ; Fri, 15 Feb 2019 17:59:02 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A6ED122694; Fri, 15 Feb 2019 01:58:59 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:58: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=/qQOqQZHbw/AR FPjmtDf3JuI9DxVWZYBJioC5qBcvMA=; b=Ba7OE4fYorJg/PnGl8Kdq4RRpHskW 0Ad3N/LfgUW3FtSUNIr7FOoKmH0mEz2JlKbH+qpbQURMJyQmIlMOcXVSuHnqjhFp fIa+m5Oe1D93DkR/G7lyY+jRtVR2ubWAeZHsNq9JOBTuWzMMdg9ePKo2u7hzsIkh edWhzK9Uy3Ircbvog8rSKizKd4ErKirlF3uxq1OatniL8PxRJqth2uuza0lNVS0H CDYYkYqHK+Omgy8B31RfTe5nujVnzgVl20CgRVBVflg1iyGVwdt86ypAgQdonxjw hh1hoz8pmjVlh8zsj388Zw2eEDj4LR+YS5DBNm2AanrKc8REpGmEG2sTA== 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=/qQOqQZHbw/ARFPjmtDf3JuI9DxVWZYBJioC5qBcvMA=; b=N2DXDwPk 2+JOJ6ad541sYLulOF13JW+jye8lfj5WlIYNi3kxfxNPYUGsnefjisC7xuLM5zIp vJDnfVBLeVTj2/9EvkH/xo4Yv68oE1GH1n2qLCql0RsKJp9ae42onQpcMMQA6bpu PFFhUcnJwMKHkJkfPPi+zCJkUyFpUzM+4i8I7eooyS1kYnQamYnVbJU1aWSkRPa8 memN+1GDoDpHsbOfHGePbvljVhtZZ8hbUZ8UTTr+oAOzeX1xqOf3P7L/reF0BasT KM84luCpxYpKtLtEZYuz5O4rQFOFLISYfa3nOd9R9QaKM2ba4ELYvoeiW++lb5p9 PnSYbcEoM7nnog== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepfedv X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id C42ACE4669; Fri, 15 Feb 2019 01:58:57 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:53 +1030 Message-Id: <20190215065708.6086-37-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 36/51] 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" 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 Fri Feb 15 06:56:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042645 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 44148s0ynhz9s4Z for ; Fri, 15 Feb 2019 18:07: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="hq3CdEra"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="M5gZEU4q"; 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 44148r741LzDqf5 for ; Fri, 15 Feb 2019 18:07:56 +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="hq3CdEra"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="M5gZEU4q"; 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 4413yc6mLmzDqVM for ; Fri, 15 Feb 2019 17:59:04 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 813DF22245; Fri, 15 Feb 2019 01:59:02 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59:02 -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=06dGi8Iahksw6 9A6SX3szl4ee2zXJYUzCVoUzz1XUSU=; b=hq3CdEra6qXaBX73/l7e4HDJIk2Vd VeqViAbxqFiK//+QjaSbTyo3p3F18227Jstn3+lRpblltgv0NH80Zv3HfTGpEtJr IalowbQFI3+DL7bYVsfmb4GMNeHWBglDUjl+s6XUMe1McdqWeTiJ8G7Nhm80k9dW q0eMbemLXmnj69g7l/hFkzQfiHchAXRq8VQTPz4gK5SM+9oT+G3Iu/UEc1d5BFxm 3l8UDg7M0x7Nc1lTfFGTyiA6/t5FfY+db8hKzw7c1nWMvnLOT5NBX+d75+PxtkDY /rEpTmoQR37L2TOC8uIs0HGPQqj/nuTa6iua9uXTXX1y6z+YzB9vo422Q== 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=06dGi8Iahksw69A6SX3szl4ee2zXJYUzCVoUzz1XUSU=; b=M5gZEU4q rD27AxnXZjNSqRchvJetw85SHhq3kyitfz9v6LHUndqEILQA2VAkixfGirciXqgC /ho63i/R8mPyl1K4j2UUN0KaqdPaMlR++WxVTzGngkmGdK1UMHIEcgC42EyPqmqk uiEqajf/vMk0kW6xFJWDHlNuuCwmSVXpd81o6DTAOU1yCe2Pj4fwKi1PC7Mv0Tkz qHNlwonX5FGblsugDu5H/jY3SEdqraYbYwYYJjB+msru6mkptwtgxpf9AvwHCczZ Vr7mmdXhv8XEKjQKlCDaQoCw1DBm5WOykj4aOB0bm0BJ7I/C0v87h948VOwFfoih hw0e0SauC96Buw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepfedv X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id E883AE409D; Fri, 15 Feb 2019 01:58:59 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:54 +1030 Message-Id: <20190215065708.6086-38-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 37/51] 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" 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..a600b5b46070 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 { @@ -165,6 +166,9 @@ void ipmi_queue_msg_sync(struct ipmi_msg *msg) assert(msg->cmd == 0x5a); assert(msg->req_size >= 2); + if (cmd->resp_size) + msg->resp_size = cmd->resp_size; + if (memcmp(msg->data, &cmd->req, msg->req_size)) { printf("Comparing received vs expected message\n"); for (ssize_t i = 0; i < msg->req_size; i++) { @@ -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 Fri Feb 15 06:56:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042646 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 4414955z1Lz9s4Z for ; Fri, 15 Feb 2019 18:08:09 +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="qmvwbmeV"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="yMyPiTdO"; 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 4414954hVjzDqgW for ; Fri, 15 Feb 2019 18:08:09 +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="qmvwbmeV"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="yMyPiTdO"; 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 4413yg1S7kzDqTX for ; Fri, 15 Feb 2019 17:59:07 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id F395C2225D; Fri, 15 Feb 2019 01:59:04 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59:04 -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=7mP7WcNDSpvEi pjZwTl3KB0dEcXlTfZmotB1TKUD3Es=; b=qmvwbmeV0+NfPLUeF0bqkWM+zG7di OYgByWCzPz1hImkAZaTdczL6/8WDiaY1jk00ihfD+pwYVdweVlKfvt6PlWhpgVLg Aq8t0HZvXpwuKLCyFJ3UJwGMdPmX5PurGFDxxtlM3lNzO5bFIepfzS/XynSFhQ9O EWjtr995jU9G2/fVcPtoHq7aXqKi/MbxHd9kamsVHRt4rL1Z3gi1KSI/1tbUia8I rGkngiPfL3wyWG83dn+EuyOVxAfj2GVFdQ1OwcpyMJMyFeyewLJZW4tdVC8tWMuW PGp29x8cyJSjbyxhSmHhwxa1GDl2N8EEY8z51CE0UBWHpazTl/66mfdSw== 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=7mP7WcNDSpvEipjZwTl3KB0dEcXlTfZmotB1TKUD3Es=; b=yMyPiTdO hYU/QlalP4SsAHgUTTHNQUiDC1rNUDi9xLPDCVh0YQEqUOilrSblMeXstATs2baC IndKneXZ72kyfjryTnScmHws9kvnJtziBfROj6STOuJ9caYaXYHbnIykVar4GelQ dFKZtExx4ynLBetVSKLEQsdcP5zVs7H44JWue47xnK2OVpFeowmdctYc9wzZuezK p4eh77kw43gzveWYt5wHX6G1YCh6FN8W+JhU/IavT3SAFUt6JluBtUi9MJfX9vos 7WtQBQPPqXPi0z5Ttz+SJkHnwi5U+ibI4oqR4CzEARqeoy6T2vBcijsviudw+8KO s3RSYvjt3BDVdA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepfedv X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id AF57EE4438; Fri, 15 Feb 2019 01:59:02 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:55 +1030 Message-Id: <20190215065708.6086-39-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 38/51] 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" 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 a600b5b46070..8d9dc235ccc7 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 Fri Feb 15 06:56:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042647 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 44149P0K4yz9s4Z for ; Fri, 15 Feb 2019 18:08: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="vPBLVIoj"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Vt9D62rc"; 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 44149N6JPzzDqdm for ; Fri, 15 Feb 2019 18:08:24 +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="vPBLVIoj"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Vt9D62rc"; 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 4413yj6l9LzDqTg for ; Fri, 15 Feb 2019 17:59:09 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 869CE21EDD; Fri, 15 Feb 2019 01:59:07 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59: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=8Z02BxfaahbjJ 5TgdZUjj8+wLOdAVEhsp6wenJcjSmk=; b=vPBLVIoj2oYDwYYXUcwCjYfs7zyq3 txzM28IMOR9LELdzCiBFyMC+nSOq5oCe0w4jghcZu19eFa9xmNxigLvcHLPwRZr5 l4iThHayr2KNmJzX+znf0SQPJduNJKVpA02DF7PfU3RtpcsfLB/9foncU0rIIbFs 7hX4r3aeSVpnuG8S9AaBzHjfe26uIx6bH6uNA0YHWSiQShGVKTCj9jAecnIQR/X+ aMpouKaA3ThXH5pv48wXQ4aOLXqqarOaDfRwOlEEA+D04jJP76zAKt4SlDIKnAXF ahK2ZKRIpVzebp0uU9hcnlPLy+qfb/37IefHEDiFEPJ7UAGzoRa3I2MBQ== 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=8Z02BxfaahbjJ5TgdZUjj8+wLOdAVEhsp6wenJcjSmk=; b=Vt9D62rc Y7/CyYZvZ5if5sUehuHPeYPBIlZjj6dS38obcVZE6OK6w8N2yb1lwKg5m2Av8mZI mIVE1Pe1e3+lwCVQL7rfIph4iUPcb/0rWpoGE9GIJi4GLRf7ZPyz+H6n8mVihCH5 Br1c8x1OC9Y+zQgGU4LnkidKK/XvVdr+Ok0g4fy0euNwZBY+4tYtKoqAdanrNBjX RqM92ocEfIcO7MGsEobBw9D+bpJ2M5cyzHGQtV2iVjlb9Ce+CPQnhagIYRcB9Xs8 fWV+94osN35ao32+AYnSHPnImyEAs4Gr0K2aWLPkmvxMhahf0mBOINyfKDPN4qFm cBMVefCNJfP44A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepfeeh X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id EDFECE4068; Fri, 15 Feb 2019 01:59:04 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:56 +1030 Message-Id: <20190215065708.6086-40-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 39/51] 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" 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 8d9dc235ccc7..15dc704a53af 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 Fri Feb 15 06:56:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042648 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 44149f6ywsz9s7T for ; Fri, 15 Feb 2019 18:08: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="aGJUxH8d"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="mHs67abf"; 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 44149f5xsXzDqjJ for ; Fri, 15 Feb 2019 18:08: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="aGJUxH8d"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="mHs67abf"; 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 4413ym2hhtzDqTF for ; Fri, 15 Feb 2019 17:59:12 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2C2CF226C0; Fri, 15 Feb 2019 01:59:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59: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=+1MDfO3ntS/6j PdgOmU/TPr6SB+fW4MXY4XJigMo1j0=; b=aGJUxH8dT91oX4Igr8ybAmm8mO3ss a1bu/ZXlAG0g5PxBIPahlcoSvItqJZcLrd+Z1IBgXEdKqavVo7SkN4I7deksWVmQ Xg8cxt5HDKj1DOaocc10r5W/Vj9+c0GJMdJiEsWZuOs3QL8/kNQfLpeIiINmfnv5 vxPHfDsHXJPXlNdfZiQZAMKoZ91GfwpKcnRe+GLvLif1c4dN15zNKWEdSNVTAU14 WYaF6e1v+xow6N20bjwvs2R5hLX3NXloL1mhXdd41HkyaVr+MPcuZT9+gomoHAMZ K8uq5ofIMwhDH40HCiFgfgShqwWuPmuA51uFvzEsjopTx5TAOrz3is9Qw== 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=+1MDfO3ntS/6jPdgOmU/TPr6SB+fW4MXY4XJigMo1j0=; b=mHs67abf AF/Av/a1eAmTBscIVjddHZrcizWAhE+f/VeS9lRcvxUHHRxjkDkAfAezdRWnKa43 fahXSQp/HUeFGzJgiB+9fxowM1u7Z2piO8U1hFBXebNRWeS0jeAtEAcNuwTvg9ke w50OfVMwZCebi9JrAV894LeH2yJOJXcuV16ni9J6bZcNu15Dy1+qbDz727tH8e9S LkPy0nq5NI1mMyD55CEoe0LV3cz2+jvrQkPpm9f8q/zkKNq6D7wl820ak0Xpx35c XcL0PpzqrGdKa2tdVaEe7C85XNk8fcDYizGec5cjvRt6/dAPQtoIVBzxmWrXXbG6 a2qSBSZ4JCM/tA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepfeeh X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 0A8F6E4068; Fri, 15 Feb 2019 01:59:07 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:57 +1030 Message-Id: <20190215065708.6086-41-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 40/51] 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" 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 15dc704a53af..8ca1144545ba 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 Fri Feb 15 06:56:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042649 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 44149x1rlpz9s7T for ; Fri, 15 Feb 2019 18:08:53 +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="ddHftPCy"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="kcQObnAy"; 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 44149x0fPDzDqkp for ; Fri, 15 Feb 2019 18:08:53 +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="ddHftPCy"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="kcQObnAy"; 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 4413yp5pmqzDqTX for ; Fri, 15 Feb 2019 17:59:14 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 9C5D22312E; Fri, 15 Feb 2019 01:59:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59: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=b+P0Z4Zp2Gv+6 uqn2BPk/UlZ3qd2oE0TQv8za+6llzM=; b=ddHftPCywKVDAH3nXi+62TvYcr4bx AKcFqvO33CnICkeziM0ixj1Ry7oTRGa6udUm1zkmxwTeFl260FaCFbw6omDttqxm Da4MGs0LeBDb32Fh/upgQ7Q7TOYp4QPThLTv2PmXHaMmmvnztigw6Gk2MCzIEplr ZAv8/k7xuMkUsK3JRxByjT4fmkplYw3PwjXBEARnUmhFo5nnDznuFT6yff5BIbfv Cxz3llmLOr5gPP5czBSYyQ0HGTX/nwb8vc2hlpo2zkEoOTnC2CuZz8sgy/fvMK+t dLk0FHZJN0HHIassVQK6Fwphq0Im9kbADMHN4fMIRQe1Y70kRl2mPob8A== 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=b+P0Z4Zp2Gv+6uqn2BPk/UlZ3qd2oE0TQv8za+6llzM=; b=kcQObnAy Rwa8JFY3rwVtgca5GDnShUP2XBeOfeGI+WaG1JQoXSQY7UG96qd3Sj9JPZ77xWgu dcn0dnd3sZ41QS96KDggFNJJvgkkcLiNNehM+fF4kBCV0qU8HwQc+TVCG2zHNFuj YJdP9Yw5hzJfFTY2/ivAcXMTMBKofQE/tR6kYHRAyHEcHYHOZdc8Mr0gQYlCwDni 9qascTz+GRgHiJSKrCmlBgXxEH/yhWKj3keg/k5Eud82vrYlqwJv2SDowVa/7WJn je7jtGJiMaONpZJXXdUFv/jGCijx5jB+RqUJ1SBVFl/djSB/iGIL0ND7P+MnIj+h mRxpZdNKRvBHxw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 61D41E4068; Fri, 15 Feb 2019 01:59:10 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:58 +1030 Message-Id: <20190215065708.6086-42-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 41/51] 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" 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 8ca1144545ba..5ac33c59107c 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 Fri Feb 15 06:56:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042650 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 4414BF5wCnz9s4Z for ; Fri, 15 Feb 2019 18:09:09 +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="oB7Wd0VH"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="6PS3XJuA"; 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 4414BF4K9MzDqlK for ; Fri, 15 Feb 2019 18:09:09 +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="oB7Wd0VH"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="6PS3XJuA"; 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 4413ys1Lx3zDqTF for ; Fri, 15 Feb 2019 17:59:17 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id CFB142310E; Fri, 15 Feb 2019 01:59:14 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59: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=AeL5HC33V/EzO BMybaXRJzGo+Ka9HWj3GXBMogQwdY4=; b=oB7Wd0VHJEIZQcWvtoFRjNPqj2MWG EUxfpQB29XX7WZFsH8Y0RxEIicd9a5A+tVcMbKcRTvOa0mHoLW1jyVQA2n4WEdKa siGwdSV1gjfaqkDsJD5zPntqVhVLY2B+Ha43w12HkBwO10O//IEO+IG/uZDERy0x FpYThgUkDVsgJMfHawJseG83/8frnS/j+llAwEoG3iMWLFeqyx1I1HPyNVBC57xp 7ftvnO62uqL6PKlF7npaUvSG0+ag0p6xU5kPeMJAe5NArD7BJTtH9BTcQ7Q5SOfR n9YcXd6UHGNBZjfpP5zDWkR3tJQgbTKR6hWhX9F9vkNmV3Ng6a+zzqweA== 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=AeL5HC33V/EzOBMybaXRJzGo+Ka9HWj3GXBMogQwdY4=; b=6PS3XJuA ltnk6Upct6d4/JBIRPYz6e+XCMzHgRSab5Lcthnqs632hJJ9vVXn9fK88Fd1JLyE tAYWmq3EUBqJvrGzV5Ycj+VXrF0DDEPPWE6Ol7yms3Gqo3NWVAu3XgZN1X8Wi35u AP1IcHkeuXg/uuKrWJ8PnARwKI4zXnEfl6snrawz4Qoh8tVaDkaWuTX4cXY68bbe t5XZsfXrSzxStS6soB1XUzCgelvz9MyBFlUMXmgbpNzXcQbC2xKwqDEne5OI2EK/ YNlcpCWKNQ/nwdQFvTqBkRnmLroofVsiHLnu3tF0lbtlGemh0MyOsFebOB0BQ+d5 TKVShXgjTspsBQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id E54A4E4068; Fri, 15 Feb 2019 01:59:12 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:26:59 +1030 Message-Id: <20190215065708.6086-43-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 42/51] 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" 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 5ac33c59107c..fbf3dd2962db 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 Fri Feb 15 06:57: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: 1042651 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 4414BW3zSfz9s4Z for ; Fri, 15 Feb 2019 18:09:23 +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="H3D8Pab+"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="kM5WvE5b"; 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 4414BW2m6VzDqll for ; Fri, 15 Feb 2019 18:09: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="H3D8Pab+"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="kM5WvE5b"; 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 4413yv2nG0zDqVH for ; Fri, 15 Feb 2019 17:59:19 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3128423117; Fri, 15 Feb 2019 01:59:17 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59: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=iIa3Na159Gi29 YF6rjYLXSJPoy+xiUM07CwZtRw6p1k=; b=H3D8Pab+7hnwBVGxNDsP/5EFJv+dH gNbfAG48XZOFC9XiA20TcGXq1DkTC+tIyeKmQWuLPAHTrnYL0JJ4prqz4FukySEs kYbRpyp+Vu6ADQZE0b61nJYqQb0t+HK0egu7CD2oox7qnUkpx2OF2ngOvyqX8KQC daYX0t9QQ9vrPWLkP+09MyrCnvGzRjB0peQRyZN5ULySbRiY4WbBp/G60RLznPbX 4Qpv3nqjRrEATFE3ErNtfxjOwANRDKUvahdbLLS7syE3oMVvF3p2QOwGUeiZcQ2e xHQ5IjYRol/TlftPwhmHh8N+24bdNbL2vm7sQSKKAEtHkPUgl5qFje7sw== 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=iIa3Na159Gi29YF6rjYLXSJPoy+xiUM07CwZtRw6p1k=; b=kM5WvE5b VYdi4vPuSaLcj93bvGzMQFS3M8OHX7IlN8Y07pJhlA3l0iBP8ipbJw6PUh42Ugk+ v8sV2U6tmLXQFpQ9w307NVOE2z2rMpI3V/1t+K+io3lBzS52w4v740uqEWkwV930 WpCyJSLDks6UKIGIOJddiwQK5bI3wg6iYw0njs7jBuNVqH7fRw5YoDYZ21AtLake Nr3ESK3JOFDzfokWrTgIOE49hQZoi1rvKJrbDDQHPZsSRGSK9fgbGhOLZ7BtE2Ip n6Aj+eeJ5FIgQdPSZ1Sdx0U9IOGO+3HX0Ym7jbEvFvinFrNuLbHlNlKfw5UymSHy kq1ZFwiTMRcN1g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvd X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 4C8AEE4068; Fri, 15 Feb 2019 01:59:15 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:27:00 +1030 Message-Id: <20190215065708.6086-44-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 43/51] 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" 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 fbf3dd2962db..3ddd6566b8a0 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 Fri Feb 15 06:57:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042652 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 4414Bl5dppz9s7T for ; Fri, 15 Feb 2019 18:09: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="VFpKKWBN"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="hlZ/fhEQ"; 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 4414Bl4gwFzDqpq for ; Fri, 15 Feb 2019 18:09: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="VFpKKWBN"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="hlZ/fhEQ"; 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 4413yx4GTdzDqVD for ; Fri, 15 Feb 2019 17:59:21 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 61FF323031; Fri, 15 Feb 2019 01:59:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59: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=B5uD/Us8ibmEb F0yTqU2TqFgP5Z587EI+YKNqBNCeCU=; b=VFpKKWBNmV9xUb2mklzbTSCCS5qf8 PiFhOs3bjQuUQtf0JuRWs4xBqlFTpvf/jYQJpwjRSwhZujspz7nidCiNl9p4JY4N RpMKkyn4Uv71aiLyIvyfmZQI6S6AGUr+zb+WufAc8wqauN26V4OrhJUxjTzX05/d fSNmYVfD0PwCoi4ixl0p4R4IvN2ZEDpsw5oxYNBepQkWxc2xbiCl6hQAeI8fg7Kc 7ilzoz7w1I4AhJXcmyEVgiqK45XK8BOZWDmz+2+WozTZiY2lafBVeT0nRoYIeRNp wZ2wbzTUxD0vV3OeRt7Lw7uRh2TJ42v0tJr2MUgvW5Eoh2NziBlDVan6g== 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=B5uD/Us8ibmEbF0yTqU2TqFgP5Z587EI+YKNqBNCeCU=; b=hlZ/fhEQ gbark4Gn5sk/i34lfeplEAc/xUni9XDa//NKVixQgEJSKJUt3jz5H70C1I3B7NxQ QbeGtZMoZ9PwGt4feCGacTTVGOVcxfkC8YuGoqc6xL7yDQaLXRSrlXvxWuS2QG4w d8m48l5JqamOYugPspVZf1wO1xn3bsva7oZ5ZMmH6OCr9jr6vFP5ODHLU/+AqDnc ynloIk/HQSEEvxtQvm2JBRUJbPFmysU8Cz45n2k6n2glGc/FY7GbChl7mCgS8D/F +vjcB8WyIYcJo8nvUmQXyI5XsqdtM016/AgaH8H0EvLVmVl7Wt+MRGNyAnvOIcmA PzOiN5tvojrqZA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvd X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 71776E4068; Fri, 15 Feb 2019 01:59:17 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:27:01 +1030 Message-Id: <20190215065708.6086-45-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 44/51] 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" 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 3ddd6566b8a0..512dcca9f4f0 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 Fri Feb 15 06:57: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: 1042653 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 4414C35qpbz9s4Z for ; Fri, 15 Feb 2019 18:09:51 +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="E+VMbx3o"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="zXnjvlIc"; 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 4414C34cXkzDqtW for ; Fri, 15 Feb 2019 18:09:51 +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="E+VMbx3o"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="zXnjvlIc"; 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 4413z03YggzDqTg for ; Fri, 15 Feb 2019 17:59:24 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 16EED23117; Fri, 15 Feb 2019 01:59:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59:22 -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=lkDJCuQJhR7RI tIRVYhXAOjQgczFBkzvD5JHLhKgpYU=; b=E+VMbx3omSCToprrXne0GoaJ7TubM eXlRMfOlkfKC2thxr2sTFKFKfwnCMQU5U8AIPZ8EB9CoOnBBx2M9k2rjf5m543GU AcAPc4HkvaTfTUHSeJ4QFlOARooSbHhxassUVE77SsdL45f9Qnx2YwwD42gpi/MW U80xx0g9zVaxO0w7Ct5aeeXK0J0qLO57g1Z7bdMJnm1K+Jgpi4WaeA0Szq84S9s1 USOaP5pjBpj9HuACERlzDXk8mrZK3v1+X7lFxEgkZxesaDjVE86ypm42hawLBAO+ A2fXD/zvkkI1O6IXbVFhF4fhFZAr9nxq6pdZzFjpPxxyfYnAp+ewLv3mw== 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=lkDJCuQJhR7RItIRVYhXAOjQgczFBkzvD5JHLhKgpYU=; b=zXnjvlIc rRrourfg+4Nj0zOwemkU2q8QqZDofOAf0dqtoItFFfF9y4qbuA4W2edyk88e7sGP sUCDuDlSYjzyjRsrvnuwmJ0QHyD6R7DJRwZoMiSxh8bkHlL+S3r4WjOXgGHOfFj9 IuB48htTrIiBkg5HMxAhpbDe8XkwgNLVxjPkWk62SHiPshHlwokrTnCZ5NVQfIlZ gYCCjjEpv/5o7n9hH0qGIroD1FUTHS1bhHxoDWdjopRNvyYVfRnxnbPoCRqOVIpI /8e/Z9xkrxgskouCqmtIEux8/xKrWxSNNE5jnektJ32PHfVfh5rjMpH1pCzsWfkn znM8/U/K4x5oGQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepvd X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id A7218E409D; Fri, 15 Feb 2019 01:59:19 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:27:02 +1030 Message-Id: <20190215065708.6086-46-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 45/51] 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" 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 512dcca9f4f0..5b8aed63db3b 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 Fri Feb 15 06:57:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jeffery X-Patchwork-Id: 1042654 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 4414CJ3Rd7z9s4Z for ; Fri, 15 Feb 2019 18:10:04 +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="AyJMBxAc"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="3QhMu8DC"; 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 4414CJ2TLMzDqvr for ; Fri, 15 Feb 2019 18:10:04 +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="AyJMBxAc"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="3QhMu8DC"; 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 4413z317wBzDqW3 for ; Fri, 15 Feb 2019 17:59:27 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id EB3B72225D; Fri, 15 Feb 2019 01:59:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59: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=G9dHeWePrzzFt B3AADgS89JxjE48/ELgC6tQpKQVtwA=; b=AyJMBxAcoY0pIpu0KSCOMcdEWXBET qYPg7CrDsqUbmWQ3r5pVQHyX8K5xAqoVhguyyqxwm95hvyzBtWdlTg//1d3TKChB +9SjGqrhXfw6VrsZP7AeeRApcEgeKyvgAdhmKy/v2qCqs+M53azDbcjyQBQM6KBH nJIuZZmeaTaHBYUmj3ZGLp0kMWhzuM55YXw2BVnBzuuwMjFc5/K43fkHFt1+0urG HvnU35qMroD1aqueqtMlVZMDMxAgp8aGETDsLhXqxmAQZN+12Gk5vndCFLoNQlsZ R1CWVM5dCVlRb2+l8zVa5ciioB8u/hFBEwuhxrAThAdOQMG6LPqclpOiA== 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=G9dHeWePrzzFtB3AADgS89JxjE48/ELgC6tQpKQVtwA=; b=3QhMu8DC lBAEEeIjePhGvDVOkrng/QuK1N8HptRsRyIG5nVpyRXvbFmmMFqiPuaHaKfAfQxQ PnKsNn1Wxlop06frh0L5J4WybMrx60u3Jeg5lOcEEOiB8/BPAnccW12h2YcCqa6Z J1s1oYtlb+42bKP6sgukBZryPNGNQIpQ2FNFlgYVClxszdWe0Xafj90Pbda/HN5r GJaWq/I2eAyfdD1FT5pqLyHd7gcjx5d0/MVNqYvEaV+hHsTPNxEeJjIQ5QkP/KUg BMwSSZROat/qaQUTPLDGDov0qELMpZa784MhahI0gMphHgpl0LxEDQZm3v+w7cP9 t2jqXg6H9vsYSQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgephe X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 91699E409D; Fri, 15 Feb 2019 01:59:22 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:27:03 +1030 Message-Id: <20190215065708.6086-47-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 46/51] 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" 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 5b8aed63db3b..90b4a670035c 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 Fri Feb 15 06:57: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: 1042655 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 4414Cd5zMNz9s4Z for ; Fri, 15 Feb 2019 18:10: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="G58p08yt"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ay18qNV0"; 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 4414Cd4Y7MzDqnw for ; Fri, 15 Feb 2019 18:10:21 +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="G58p08yt"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="ay18qNV0"; 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 4413z546Q7zDqV4 for ; Fri, 15 Feb 2019 17:59:29 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5E1D22227E; Fri, 15 Feb 2019 01:59:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59:27 -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=EMDenP3K8OzFS IB9qqdxA9Lwn4As11uMeiYMs/o5bXg=; b=G58p08ytZ+cTZvbAO1rOVC5+UdviJ mmV487DhdR8cyZYUVeNuokptH1IoYSnGdwEyk6otdOuu5ur7P1W8hQi9TWXx5AlI k2VJNzGFeGfJ6gF13jeFEDRECys5+vB2q4Taf3HhQZ/2Frm2f4qDX46wahaf6I3R x86I/VLcoHr+voiSWJ9Gzj8dg3Gvlp5jA/PfERcOkf2qR20WhHvE9JC57zNPMVP2 3z4whkN6uZKYNdPngJtyqAz2Tqf8AstN9a/m/M6+NhqKyjkWa+EibLTxE8dagmvS g0rUZ+WDLpK37nFjKcUq/bQm4pGOmJVUxhjBEeRlercIwEJVRXDt646fQ== 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=EMDenP3K8OzFSIB9qqdxA9Lwn4As11uMeiYMs/o5bXg=; b=ay18qNV0 7IkdcPBJLX7CL39cJ8Ad+M2bDu9kqmi9yyuXqfzAPhQ5R03gZWgyD24Nc9gx3GOi 8UpBUPZ43NfAVuUoJw3RE4+RFrloHrhZTiAf9jXVs98LrIzhBdIJ1fbX1s2Echbh yAcaW4sGWQA68Ak2UCZYUVq6PWoTcVZXEjDDN7p4oxXLF6GPhqBbwMkEsETs8GsK nw7u31UOJeJJa7umiN6+jKw55uDuXib0oYKvUhhwGGnTqOe29QRQJGMJuKK80tOx 7cm5GPuQnF/4VIPcJK1r8N24JGp4HMfAcaZ3WjGoelc9PFvO+ygKbbsqcx1ectBx F+r38vMJ6hO9Eg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgephe X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 55446E409D; Fri, 15 Feb 2019 01:59:25 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:27:04 +1030 Message-Id: <20190215065708.6086-48-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 47/51] 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" 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 90b4a670035c..11948808d9b9 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 Fri Feb 15 06:57: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: 1042656 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 4414Cv0DF3z9s4Z for ; Fri, 15 Feb 2019 18:10: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="Cll6Z9Ie"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="xyAex07I"; 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 4414Ct5nwdzDqv2 for ; Fri, 15 Feb 2019 18:10:34 +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="Cll6Z9Ie"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="xyAex07I"; 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 4413z76zlVzDqW7 for ; Fri, 15 Feb 2019 17:59:31 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id AD7F8226C0; Fri, 15 Feb 2019 01:59:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59:29 -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=c50IXm6CmUqHv l6WM87VuBRBWbN8JNi6Co3ZtC0giec=; b=Cll6Z9IeUkf92sftI55a6aYl66yKV BnI5aq/Yy39Z0DbUgNX6DgYi3ZmZmWFn6j4Evg+wY/NdMESn/L1ynk8LqxS5CHT5 1uCfWToAfWiQI3HIRJaplj2B/k478cKm++jrhhQLOk/QtfMb6aDGY3FnQV8EtQUm KK6U7eZFDVJbF63YrlQIlDyDts1pjn0ql6/YVE+kMf1MPEXVcyRO7Q/6TwLiJF0w JqPCYBety3KQ8LRLdyVXnC+jiJ3enOG+0x8ggxT9nGdaUVb+gPpjUUSyqG2Oj1xo iMo9UTiWpY/3+2Dt+gm8dYCByrxGLEqPMrfjNZvx1EbSbNdfwjhQLDFag== 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=c50IXm6CmUqHvl6WM87VuBRBWbN8JNi6Co3ZtC0giec=; b=xyAex07I emKla2774cZqggeVHDHAPqBQolKXWumijQlea5OHPb2HD8+EvvpNdF4mqz+SVekr tv836WzMQYaG9eFdiXEq+ECPbt/rXCFg+F3aYCbPK9DePunrel1qkZl8z9de6l++ WYjIkUVLiOyGGWEj9/HFp+7wlB2zt4kxGHXrCwMin2iEeQjGn4nKjwD5VI7D+EQr w0tiHwjto8hkojsL64X7YH0UFxcVEwXX04SYIwnUpLVFDLg2gLToZSXBWdaWMeAM gYbs8ptyWrp/woUfXP9xwJlinqI1oRWPPUlougu3MRGF0Id+gncayW1y9t7iemL1 UL7j0f1WtC9aJg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepje X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 94555E409D; Fri, 15 Feb 2019 01:59:27 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:27:05 +1030 Message-Id: <20190215065708.6086-49-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 48/51] test-ipmi-hiomap: Add protocol-recovery-failure-restore-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" Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 197 +++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 11948808d9b9..db8575c73543 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -2391,6 +2391,28 @@ static const struct scenario_event hiomap_recovery_get_info_call = { }, }; +static const struct scenario_event hiomap_recovery_get_flash_info_call = { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 9, + .args = { + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 9, + .args = { + [0] = 0x00, [1] = 0x20, + [2] = 0x01, [3] = 0x00, + }, + }, + }, + +}; + static const struct scenario_event scenario_hiomap_protocol_recovery_failure_ack[] = { { .type = scenario_event_p, .p = &hiomap_ack_call, }, @@ -2893,8 +2915,182 @@ static void test_hiomap_protocol_recovery_failure_get_flash_info(void) */ 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(); +} + +static const struct scenario_event +scenario_hiomap_protocol_recovery_failure_restore_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_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_event_p, + .p = &hiomap_recovery_get_flash_info_call + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 10, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_ERR_UNSPECIFIED, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 11, + .args = { + [0] = HIOMAP_E_PROTOCOL_RESET, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 11, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 12, + .args = { + [0] = HIOMAP_V2, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 12, + .args = { + [0] = HIOMAP_V2, + [1] = 12, + [2] = 8, [3] = 0, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 13, + .args = { + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 13, + .args = { + [0] = 0x00, [1] = 0x20, + [2] = 0x01, [3] = 0x00, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 14, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 14, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 15, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 15, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 16, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 16, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_recovery_failure_restore_write(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_protocol_recovery_failure_restore_write); + 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); @@ -2959,6 +3155,7 @@ struct test_case test_cases[] = { 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), + TEST_CASE(test_hiomap_protocol_recovery_failure_restore_write), { NULL, NULL }, }; From patchwork Fri Feb 15 06:57: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: 1042657 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 4414DC5hfSz9s4Z for ; Fri, 15 Feb 2019 18:10:51 +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="jv1btIpu"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Z5iGGDmS"; 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 4414DC4b9rzDqxm for ; Fri, 15 Feb 2019 18:10:51 +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="jv1btIpu"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="Z5iGGDmS"; 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 4413zB1y0RzDqVN for ; Fri, 15 Feb 2019 17:59:34 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id D17DC23117; Fri, 15 Feb 2019 01:59:31 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59:31 -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=z0PzpIo2229zr W7Fzr3eeVe800Ue7Yb+yeOthDSZokg=; b=jv1btIpuWx9VZCDfBiZIkxdIrOUP9 EtSPG6Whz3bpMOB3dr6csObpbY0U0A0Ziph9jiN71TzWMIcxklJCGGJ3Bo6I2Jbd FiWvGd5Sv3LH6MzpwUk2GD9BZFL3QNfdsitxwsvzi00GlNFfjpfEpb2FHYmaYZ84 PsT0RqUEy/ZUv3/ZzLZc1NEpK9ANVxBQ4eaBiqfLi+MNGiK9aSXh2lYPhS3IG0f+ wuBvLQSQuqfkgwKHtnY9zJ2c6eHL1/AJjh+TMtxizzILgUd8FNzFmABFo8FYTsHa MJ1ebnpVRN91cs2TviEYnav6VNYsg4o9yrj9GmnjdpQSV78E1jIsrE+dg== 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=z0PzpIo2229zrW7Fzr3eeVe800Ue7Yb+yeOthDSZokg=; b=Z5iGGDmS 6T9Lz+WmzTNoqUA9f0h9ywu1rqA+yPHhCHEItTcQ6uLt4Fc2G2oIe5PXGIUrZRMq MH7wcIyBGI+2pvM4EomNBrgvSvhCq+VaXlW1NK04kDC4dpub76cvryQVBUAUiAKa dEWna6OZIrYsisoCGdp9gudMeoByzw+IF+enhllBiPzg+82JKJMY7cq9attwhg8q vtu/vtbec5HnXFqPvDeuXOXqC2lp0mDzD10r+5j7DFYBQVaOjVuZpv4imLC7RnBX ZxlQBNV644+uCW483DcPPKdtwVsSZDudm++eFfz8Yc5f9QZ5Riatz1vpc63DoEX1 JRTyn8J95G/5tg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepje X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id E9B44E409D; Fri, 15 Feb 2019 01:59:29 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:27:06 +1030 Message-Id: <20190215065708.6086-50-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 49/51] test-ipmi-hiomap: Add protocol-recovery-failure-restore-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" Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 203 +++++++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index db8575c73543..394355092613 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -3097,6 +3097,208 @@ static void test_hiomap_protocol_recovery_failure_restore_write(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_protocol_recovery_failure_restore_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_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 = 5, + .args = { + [0] = HIOMAP_E_PROTOCOL_RESET, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 5, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 6, + .args = { + [0] = HIOMAP_V2, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_INFO, + .seq = 6, + .args = { + [0] = HIOMAP_V2, + [1] = 12, + [2] = 8, [3] = 0, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 7, + .args = { + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_GET_FLASH_INFO, + .seq = 7, + .args = { + [0] = 0x00, [1] = 0x20, + [2] = 0x01, [3] = 0x00, + }, + }, + }, + + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 8, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .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_READ_WINDOW, + .seq = 12, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 12, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, + }, + SCENARIO_SENTINEL, +}; + +static void test_hiomap_protocol_recovery_failure_restore_read(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_protocol_recovery_failure_restore_read); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + /* + * We're reading the same block 3 times - it's irrelevant, we're just + * trying to manipulate window state + */ + buf = calloc(1, len); + assert(buf); + assert(!bl->read(bl, 0, buf, len)); + scenario_advance(); + assert(bl->read(bl, 0, buf, len) > 0); + assert(!bl->read(bl, 0, buf, len)); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -3156,6 +3358,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_recovery_failure_get_info), TEST_CASE(test_hiomap_protocol_recovery_failure_get_flash_info), TEST_CASE(test_hiomap_protocol_recovery_failure_restore_write), + TEST_CASE(test_hiomap_protocol_recovery_failure_restore_read), { NULL, NULL }, }; From patchwork Fri Feb 15 06:57: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: 1042658 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 4414DR6Xncz9s4Z for ; Fri, 15 Feb 2019 18:11: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="nSskuLEJ"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="MBbrICky"; 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 4414DR5JC5zDr0p for ; Fri, 15 Feb 2019 18:11:03 +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="nSskuLEJ"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="MBbrICky"; 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 4413zF6HcJzDqW3 for ; Fri, 15 Feb 2019 17:59:37 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 7F9F42225D; Fri, 15 Feb 2019 01:59:34 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59: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=Oqt1GUycHMVsN K3rCE0rUdhaKGI1KlABFBPTX2EsAIw=; b=nSskuLEJr5cphJvDtLB/o82jqWVIm wsEvIgoqoMyv10OoELQ2QALJBIl0sKC+BUGvn4S/zvAZrS/P+9k1jvlezWp04UaE l/YJl2BG+9fh/Nry4XusTWT9H1e92A4EEzF4zyzvJFHgqF0wEAyYuM9jOzbY9hCk ycx3wKy+uPJUbhq+wDlvNwkuR15f5JZ6PMgPvj1yJmZU+UABNFPaJIsoVE3YA5V7 UyHPezR6Ls3FGB4tKogR81vE6PLwuJuzhXMfZNaOxaogHz24o8FgmKwVkioUBQP9 zIV8Sr0imUz7FNgZgWWonqz5RDOUcBp6tJHkfW5grNWvP52v51iwh37tA== 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=Oqt1GUycHMVsNK3rCE0rUdhaKGI1KlABFBPTX2EsAIw=; b=MBbrICky /pWNo+XPNs3QcJhPywHdRJ4Ys8Yu44dlv+EpCi74m256KUkNNVUJjWPxHd5qMbu1 27VqgEt9fk6Xj6lQBZ8S0f+89rG3JCmEHI/fKLyToLkdMM4oJzxfhXIJEsPvzE6j Cn5oR43d0mH5CgU72WgORJQCw+q1HwBeF8kPsPnGwwACBOEyZYtZ3F0Bt4kGy4Qn beCbfk7BKS8yOk6xiaZNccDFW4BmeVFj/m85Eu37wZiCmxwfQk1fnExd6ZdHlUB9 TbdzGxiu6SjANsBzlCJyoHka63JslTthUz2xugfxALGfno+M5J17P3wuntjhUoIb WuTm7O2EtoJY1g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepje X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id 3F511E409D; Fri, 15 Feb 2019 01:59:31 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:27:07 +1030 Message-Id: <20190215065708.6086-51-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 50/51] test-ipmi-hiomap: Add window-recovery-failure-restore-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" Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 119 +++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 394355092613..234c30bd76b5 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -3299,6 +3299,124 @@ static void test_hiomap_protocol_recovery_failure_restore_read(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_window_recovery_failure_restore_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_delay }, + { + .type = scenario_sel, + .s = { + .bmc_state = HIOMAP_E_DAEMON_READY | + HIOMAP_E_WINDOW_RESET + } + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 5, + .args = { + [0] = HIOMAP_E_WINDOW_RESET, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 5, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 6, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_ERR_UNSPECIFIED, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 7, + .args = { + [0] = HIOMAP_E_WINDOW_RESET, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 7, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 8, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_READ_WINDOW, + .seq = 8, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, + }, + SCENARIO_SENTINEL, + +}; + +static void test_hiomap_window_recovery_restore_read(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + void *buf; + + scenario_enter(scenario_hiomap_window_recovery_failure_restore_read); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + /* + * We're reading the same block 3 times - it's irrelevant, we're just + * trying to manipulate window state + */ + buf = calloc(1, len); + assert(buf); + assert(!bl->read(bl, 0, buf, len)); + scenario_advance(); + assert(bl->read(bl, 0, buf, len) > 0); + assert(!bl->read(bl, 0, buf, len)); + free(buf); + ipmi_hiomap_exit(bl); + scenario_exit(); +} + struct test_case { const char *name; void (*fn)(void); @@ -3359,6 +3477,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_recovery_failure_get_flash_info), TEST_CASE(test_hiomap_protocol_recovery_failure_restore_write), TEST_CASE(test_hiomap_protocol_recovery_failure_restore_read), + TEST_CASE(test_hiomap_window_recovery_restore_read), { NULL, NULL }, }; From patchwork Fri Feb 15 06:57: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: 1042659 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 4414Dk1PS2z9s4Z for ; Fri, 15 Feb 2019 18:11: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="reDWhZfl"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="GcKS2H8D"; 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 4414Dk0J82zDr1b for ; Fri, 15 Feb 2019 18:11: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="reDWhZfl"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="GcKS2H8D"; 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 4413zG6FQZzDqVN for ; Fri, 15 Feb 2019 17:59:38 +1100 (AEDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id A64EF2316B; Fri, 15 Feb 2019 01:59:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 15 Feb 2019 01:59:36 -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=Fl9kl/zpHGY+X BPT+/XHcrrJclEArfU+y0/Qeotvxpo=; b=reDWhZfla4zNV3X4v84tflrTapxNh OjwY9GysslKTdmCtVpkjm+lhxYD5eAoLW0YRvEylYOkkNVxBxHCyOgseLXmkUIwR kqXjcrwRdbowc/BJMyH3Ciirgyg7ZCA47hXXkDmzAv9FrlKIkm0RqhDG7WYTc1Pz CGf5Q7g5lp5MuciDcy6soM6SaONpRknf4ux0WV+i6x3Ggfv5UzYSLtVHx3Y64C3a Aw/F9Zo2sNupLEBz78ZQDoo3CpUWmMT5ldxmCyIG+hpETYHGSzWqKwdYY/ndlU1P hONjEOcFH0v3bwrWnUbpkAJirhk0g91Q1m+mRP6tBvcoQeucTlApwEi6Q== 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=Fl9kl/zpHGY+XBPT+/XHcrrJclEArfU+y0/Qeotvxpo=; b=GcKS2H8D kxW8zSHM5AMlknVbUP3FRRLWk83X6sx0v89MG5HZ72r7bipl/r11ejcs4N5vMMZW l08lRUxEGfm05BG8u6oWyonc9fXCs98btJgHdinRQEyERhE39RBZUyUqXJajVm7a 8xtBINp6kB+8EHXtyYXJkpYnwxixE1CIoJwtP/RDXSI7sSdyx/8tP0YWlIOniPqt /TaY9D5l8Cztm8/NhcTzkO4cbnpp30t+2YTnLPOndsMJefwPbhDXB/rxyg4/odkF 9adpSLh8xi/Xl3xMZRuwIKl1b41u/1MhDLNbVlERDdiFvDp0zpRT/yaD9J+lHXjq FOI0mMehNYwx6Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddtiedgleelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpe etnhgurhgvficulfgvfhhfvghrhicuoegrnhgurhgvfiesrghjrdhiugdrrghuqeenucfk phepudegrddvrdekledrjeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvfi esrghjrdhiugdrrghunecuvehluhhsthgvrhfuihiivgepuddt X-ME-Proxy: Received: from localhost.localdomain (unknown [14.2.89.75]) by mail.messagingengine.com (Postfix) with ESMTPA id BC4C1E4068; Fri, 15 Feb 2019 01:59:34 -0500 (EST) From: Andrew Jeffery To: skiboot@lists.ozlabs.org Date: Fri, 15 Feb 2019 17:27:08 +1030 Message-Id: <20190215065708.6086-52-andrew@aj.id.au> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190215065708.6086-1-andrew@aj.id.au> References: <20190215065708.6086-1-andrew@aj.id.au> MIME-Version: 1.0 Subject: [Skiboot] [PATCH 51/51] test-ipmi-hiomap: Add window-recovery-failure-restore-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" Signed-off-by: Andrew Jeffery --- libflash/test/test-ipmi-hiomap.c | 147 +++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/libflash/test/test-ipmi-hiomap.c b/libflash/test/test-ipmi-hiomap.c index 234c30bd76b5..1e53eed61bf5 100644 --- a/libflash/test/test-ipmi-hiomap.c +++ b/libflash/test/test-ipmi-hiomap.c @@ -3417,6 +3417,152 @@ static void test_hiomap_window_recovery_restore_read(void) scenario_exit(); } +static const struct scenario_event +scenario_hiomap_window_recovery_failure_restore_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_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_WINDOW_RESET + } + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 7, + .args = { + [0] = HIOMAP_E_WINDOW_RESET, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 7, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 8, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_ERR_UNSPECIFIED, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ACK, + .seq = 9, + .args = { + [0] = HIOMAP_E_WINDOW_RESET, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_ACK, + .seq = 9, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 10, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .cc = IPMI_CC_NO_ERROR, + .resp = { + .cmd = HIOMAP_C_CREATE_WRITE_WINDOW, + .seq = 10, + .args = { + [0] = 0xff, [1] = 0x0f, + [2] = 0x01, [3] = 0x00, + [4] = 0x00, [5] = 0x00, + }, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_ERASE, + .seq = 11, + .args = { + [0] = 0x00, [1] = 0x00, + [2] = 0x01, [3] = 0x00, + }, + }, + .resp = { + .cmd = HIOMAP_C_ERASE, + .seq = 11, + }, + }, + }, + { + .type = scenario_cmd, + .c = { + .req = { + .cmd = HIOMAP_C_FLUSH, + .seq = 12, + }, + .resp = { + .cmd = HIOMAP_C_FLUSH, + .seq = 12, + }, + }, + }, + SCENARIO_SENTINEL, + +}; + +static void test_hiomap_window_recovery_restore_write(void) +{ + struct blocklevel_device *bl; + struct ipmi_hiomap *ctx; + size_t len; + + scenario_enter(scenario_hiomap_window_recovery_failure_restore_write); + assert(!ipmi_hiomap_init(&bl)); + ctx = container_of(bl, struct ipmi_hiomap, bl); + len = 1 << ctx->block_size_shift; + /* + * We're reading 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); @@ -3478,6 +3624,7 @@ struct test_case test_cases[] = { TEST_CASE(test_hiomap_protocol_recovery_failure_restore_write), TEST_CASE(test_hiomap_protocol_recovery_failure_restore_read), TEST_CASE(test_hiomap_window_recovery_restore_read), + TEST_CASE(test_hiomap_window_recovery_restore_write), { NULL, NULL }, };