From patchwork Mon Feb 1 15:26:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 374277 Delivered-To: patch@linaro.org Received: by 2002:a02:b18a:0:0:0:0:0 with SMTP id t10csp1398288jah; Mon, 1 Feb 2021 07:33:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgZxNeZu/rg7oGraSAKr8ZOct+oaVGOl9PrvSOqA/Vt6wU6MdvIKBU/bzyilWvn0+gF8jb X-Received: by 2002:a25:81c7:: with SMTP id n7mr25027860ybm.171.1612193622916; Mon, 01 Feb 2021 07:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612193622; cv=none; d=google.com; s=arc-20160816; b=Gwcxy3PeKxHVlVsSPBE1a2aDH/l/Uec1tckE/r4UznnF6nxvrwYtXtSQPLWy+varv0 11Xm61yWX8laEb9Y4jxlya/UlUv2+XVUKwoxl7aXx/bl6NcVgf6bVjadaXb69xA6Epk0 6zc8t/DaNcxjKIxIdzRwB8sqvwxvQq3Kx7TxIDo2hrZSl5bmLnMY1Yzf8CRbFxiYO3xf qPBGX93h8EZBgwQtypWl3Ubm2tKQNvE2juDePt1yGakfn8nTfRyuo6t8ucG/h4zxJPDC i2E+lhGIIaB682xmyWpnRK2nuf751X92geMbduc9AbDgH7Qz8tW6nZng7UZAB/cABoLE 8iXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=um8wfiBk1wk11qzW8nZjnqHDGl9BTKViJkF0EO07Wgo=; b=tkMwhDKx6NzmS++130W8zaqQf+f8ZtXa6DTMj/I2nooKlc3sUw6fwqqaH37rVWMiG4 QCGJiTG0ZV6MA9od69NTxuVXZxtYNqaJwP7HdgCvPTOx5VuIRw5HRK0VQvg4naDdW3Zn wXpfDHswb95iBJVZ1n2PFyl53voW1M6LNUrr5Ey70AtuoQpcIeFgHmnm8sRewwyIEVq3 XbfUkZ0QIspiBLsQ+5f5x+aH02aZBezXonIJgrsAxDXl6QCxu34oi4Y+I6s3kQ6gW2ab IOzWHCPKHMBpzce//RvaKBkeZGB0OVv2trl7x29DvC55GuI6QmARLPsNYqC3nEY81rvd QeEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n200si924329yba.25.2021.02.01.07.33.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Feb 2021 07:33:42 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:39692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6bCw-00036O-BD for patch@linaro.org; Mon, 01 Feb 2021 10:33:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bBY-0001QL-9Z for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:32:16 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6bBW-00005g-Gb for qemu-devel@nongnu.org; Mon, 01 Feb 2021 10:32:15 -0500 Received: from fraeml745-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DTsGj1rgwz67jjw; Mon, 1 Feb 2021 23:26:05 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml745-chm.china.huawei.com (10.206.15.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 1 Feb 2021 16:32:12 +0100 Received: from lhrphicprd00229.huawei.com (10.123.41.22) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 1 Feb 2021 15:32:12 +0000 From: Jonathan Cameron To: Subject: [RFC PATCH 3/3] hw/cxl/cxl-device-utils: Allow incorrect read lengths Date: Mon, 1 Feb 2021 23:26:55 +0800 Message-ID: <20210201152655.31027-4-Jonathan.Cameron@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20210201152655.31027-1-Jonathan.Cameron@huawei.com> References: <20210201152655.31027-1-Jonathan.Cameron@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.123.41.22] X-ClientProxiedBy: lhreml751-chm.china.huawei.com (10.201.108.201) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Received-SPF: pass client-ip=185.176.79.56; envelope-from=jonathan.cameron@huawei.com; helo=frasgout.his.huawei.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Thomas Huth , Ben Widawsky , "Michael S . Tsirkin" , Jonathan Cameron , Vishal Verma , f.fangjian@huawei.com, Chris Browy , f4bug@amsat.org, linuxarm@openeuler.org, jcm@redhat.com, Prashant V Agarwal , Igor Mammedov , Dan Williams , Richard Henderson , alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is currently needed to avoid an issue in the Linux RFC in which a read is issued that is not a multiple of DW. On arm64 that results in byte reads being issued and a bus error returned. It is not yet obvious at what level this should be fixed, so paper over it to get things working. Not-signed-off-by: Jonathan Cameron --- hw/cxl/cxl-device-utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.19.1 diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c index d0d0a47122..52dd03384a 100644 --- a/hw/cxl/cxl-device-utils.c +++ b/hw/cxl/cxl-device-utils.c @@ -181,11 +181,11 @@ static const MemoryRegionOps mailbox_ops = { .write = mailbox_reg_write, .endianness = DEVICE_LITTLE_ENDIAN, .valid = { - .min_access_size = 4, + .min_access_size = 1, .max_access_size = 8, }, .impl = { - .min_access_size = 4, + .min_access_size = 1, .max_access_size = 8, }, };