Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp2541743rdb; Mon, 25 Dec 2023 16:47:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCjwXTJevi6sG14QQ3l7KSsTF7QH8mcY2modhpy8MpI3lqw6gcgR6fyoIAIeQLYz/QkGgw X-Received: by 2002:a05:6358:880c:b0:174:b61a:431 with SMTP id hv12-20020a056358880c00b00174b61a0431mr6773172rwb.0.1703551665696; Mon, 25 Dec 2023 16:47:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703551665; cv=none; d=google.com; s=arc-20160816; b=grjL+A3BOi4bl3HFZuVuPP0BrTKbEuFEBF3wmq1h4dlL/DQTxwA5S0BogNCnelaykM qaFbPt1ofltPDHocR9O9RA6dJf/xIStf6uOGMN/k8Enrh9yaGs2yPYluabPet4nuSZRE wRj4omt+AWfJXsnYN2Cf7NogO/1apMaQd4zZ2sJR58JSBelzIO7f5XYcS1bcSbBxXBKI x29QwDh7HG5A64kUWxhtewwsWE/HEk0uE/kKNxiSi0meYe9nOmWIGxV8rfTBRFKeVfo7 XjIT2vFwnphsRrHkNrJxizmZ3zSx0UxoQR71esifGFdEyYXcTUYYjywGPDCSl/R4yeTN 9U0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Ob7ldBEhY3TzzONWd9t3MUALnmhbpvnZT3vERZ/mdM4=; fh=02Qn2gAu97NNJHJzv0Y636OxLmfmshuje08cGGIKjdU=; b=N5A0cCghgyhYnAW3pxsPnS152FHPr86rPmF7RV/GoU52C9Q6iSWM2YWxTPGWLd6i9w /CQheAdyjpfvK649jCxSz8j69iYuDzqVhzmORuBly/z5huEmM0fXCcAFu4Zz+BeJtkC8 DM2zUvFFVdQIpUkBl5qo+L886hpWoc8nhybvm9fUA5Ldv6vNV/Ijc37sKvGcGPSjs4Fk 6tdH7S7NWgGPqCfX3k0xjHRsGY6bMseTbDbtiRgSH77/896aUnpbnvgQO3L/dGF6mUtn 8IiWPemn3N86IsCKXcSgx63dKbeqf8T2XnD9/SYA6qnjmtkfIeAhPX08uOIou80oX3Di dy1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RFR0uRu9; spf=pass (google.com: domain of linux-kernel+bounces-11289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id on1-20020a17090b1d0100b0028ae45912afsi8846439pjb.50.2023.12.25.16.47.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Dec 2023 16:47:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-11289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RFR0uRu9; spf=pass (google.com: domain of linux-kernel+bounces-11289-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-11289-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 53946280D12 for ; Tue, 26 Dec 2023 00:47:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 553C55EE85; Tue, 26 Dec 2023 00:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RFR0uRu9" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 82F155EE95; Tue, 26 Dec 2023 00:27:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69FB9C433C8; Tue, 26 Dec 2023 00:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703550426; bh=pUI+BkAkFtp05WdgjDZvtYYBdmXmtT6NR+Yefnz7D/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RFR0uRu9sdkgwtOVy3AYWxj6fIiRu8ufQutTkuMCOFcDIqixMxE3MqTuojfj2kAWk tdMUxhEl0VGn2RDgRASgQg2PG/Z9tc5WC7G6hOjqgg4SoHXWDiphZHW3UnE3osXIu0 Zig+khU5Uxd3NwFdOCgyjnlwH5zhRSbDDAdJ8UWWtHKWZtFgXkyk+/IGlFt4WgFF4h CAGKJ9wayQ65y2IJ0oXneRFiNBeWCyEiMbt4oR+FcdQI0FtL52WBmqsufjOAn1KNc5 wo0Z55EoHt/CTaF7Qs7HpBcsvwtP0+U4JfvG4nfuQupcAqq7CBTaQ+sKEquq8fwlz+ MXtm184vEwRBA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Vineeth Vijayan , Peter Oberparleiter , Alexander Gordeev , Sasha Levin , hca@linux.ibm.com, gor@linux.ibm.com, linux-s390@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 5/7] s390/scm: fix virtual vs physical address confusion Date: Mon, 25 Dec 2023 19:26:29 -0500 Message-ID: <20231226002649.7290-5-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231226002649.7290-1-sashal@kernel.org> References: <20231226002649.7290-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 4.19.303 Content-Transfer-Encoding: 8bit From: Vineeth Vijayan [ Upstream commit b1a6a1a77f0666a5a6dc0893ab6ec8fcae46f24c ] Fix virtual vs physical address confusion (which currently are the same). Signed-off-by: Vineeth Vijayan Reviewed-by: Peter Oberparleiter Acked-by: Alexander Gordeev Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin --- drivers/s390/block/scm_blk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/s390/block/scm_blk.c b/drivers/s390/block/scm_blk.c index e01889394c841..d3133023a5574 100644 --- a/drivers/s390/block/scm_blk.c +++ b/drivers/s390/block/scm_blk.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "scm_blk.h" @@ -131,7 +132,7 @@ static void scm_request_done(struct scm_request *scmrq) for (i = 0; i < nr_requests_per_io && scmrq->request[i]; i++) { msb = &scmrq->aob->msb[i]; - aidaw = msb->data_addr; + aidaw = (u64)phys_to_virt(msb->data_addr); if ((msb->flags & MSB_FLAG_IDA) && aidaw && IS_ALIGNED(aidaw, PAGE_SIZE)) @@ -196,12 +197,12 @@ static int scm_request_prepare(struct scm_request *scmrq) msb->scm_addr = scmdev->address + ((u64) blk_rq_pos(req) << 9); msb->oc = (rq_data_dir(req) == READ) ? MSB_OC_READ : MSB_OC_WRITE; msb->flags |= MSB_FLAG_IDA; - msb->data_addr = (u64) aidaw; + msb->data_addr = (u64)virt_to_phys(aidaw); rq_for_each_segment(bv, req, iter) { WARN_ON(bv.bv_offset); msb->blk_count += bv.bv_len >> 12; - aidaw->data_addr = (u64) page_address(bv.bv_page); + aidaw->data_addr = virt_to_phys(page_address(bv.bv_page)); aidaw++; } -- 2.43.0