From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB7ACCD37B0 for ; Mon, 18 Sep 2023 12:34:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 50E528D000C; Mon, 18 Sep 2023 08:34:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4E54A8D0002; Mon, 18 Sep 2023 08:34:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 385E88D000C; Mon, 18 Sep 2023 08:34:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 24F998D0002 for ; Mon, 18 Sep 2023 08:34:51 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EAA8BB37B1 for ; Mon, 18 Sep 2023 12:34:50 +0000 (UTC) X-FDA: 81249662340.25.8B45993 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id AED9D1C0029 for ; Mon, 18 Sep 2023 12:34:48 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cagzNilN; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695040488; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=IxFBEQg9b7yDnMf45q5jDLqhs0KEwZwJPO2ZTdtr6EU=; b=xjlJZpkTDG2YjB5/1cQ9F9NXm1qBqVXBpcHx0FLKzIjTerGuGyAWbuxahRIYhrNRcVv+wV YumWgV4K1GL0HDip2NJyTNq+a4bZN73kIrylyXZ6T6Nz8Abwm5IuKGIT9Y0GaTH5RFEa44 vRUb8Utb2lB/VCQJXYuod+NzvErei+E= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=cagzNilN; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf20.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695040488; a=rsa-sha256; cv=none; b=Hd+L8E3lSDW2InpR4JYC/grm+FOanKncS/BpAXsq8bpJCP2G+HUkhF2C9SaPqZqAjLW3ax KhIjTvsBY/YOECHBKGUjS1KuDyHQYALgIGdWEQaI/e9hFjjPh6wWBwPaYF97GOKgZg5VB+ Hj/PBDmBI4FdKKD0pvnfXOQqkJpu7QI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695040488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IxFBEQg9b7yDnMf45q5jDLqhs0KEwZwJPO2ZTdtr6EU=; b=cagzNilNjEvqesMQh7H038SBngS7Ws6Vcu1u74HETHbPZH0WUvaidzSzL7gt6oSW57o4QQ QzBKDKGcqwtAx60XNdUID1wi03mDxZ7TKHEUYppTQOij+YFl4/IcCbl/5JnJT61yth80dF O9hWyi7TMqmZ7llxel2mIXGS6oG8ZBM= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-498-RNOpKRKmMjSaj9OlZoTZig-1; Mon, 18 Sep 2023 08:34:46 -0400 X-MC-Unique: RNOpKRKmMjSaj9OlZoTZig-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4011f56165eso22814325e9.0 for ; Mon, 18 Sep 2023 05:34:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695040485; x=1695645285; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IxFBEQg9b7yDnMf45q5jDLqhs0KEwZwJPO2ZTdtr6EU=; b=Ub7+t1IbsHvxTOYoa/tV3Hlijx8H1c+7QdwWHTCZhTfCzcj4yjzd6rfrZV9Z0rcopL uQF/JSgo/E7Ho4stRe2/v6UnuTF7chIybAgW4RbK+TGQx7lnGDBSz1UFygXOiJKzgOQt sr9ecH1nZcArPpQpthE+bm75MAkx3eBwjrrL8zxUzZQJUPpaa9JPad8vnMDpvxpMioJB sGbSq+36yUMHmrwNeIBqNUZGqoUchb2rmh6v53iOjnaM5sF8qQ5HjsIFl9r/St2npZID clnmiasvFfpg+hDfZ0IkwzKLmnh6FFGKr+CNLhfQtwfAvykaNgOGbImBjYoP5XSFuDtv bUmg== X-Gm-Message-State: AOJu0Yy47JgsUfbLIp24sEEAjMz0IU/L2MNGV1fOYah5rKAuOV0u/H/E LPZQWeJU46RVb4jwZzgrw62flm80KgCMu4xa3J6ooq5j3cSYQNKoEOyFXC4/sG5zYm/gKBzKdVD fkJMZ3SMaQWY= X-Received: by 2002:a05:600c:28f:b0:402:e68f:8a4f with SMTP id 15-20020a05600c028f00b00402e68f8a4fmr6611922wmk.0.1695040485469; Mon, 18 Sep 2023 05:34:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGaeDx1qVaRUmxQ681t+ZPcMtzpakFvnIYiPyEpet9vdJoZO7fGocfGRpPzZdBXcMLYaAhZPg== X-Received: by 2002:a05:600c:28f:b0:402:e68f:8a4f with SMTP id 15-20020a05600c028f00b00402e68f8a4fmr6611890wmk.0.1695040485051; Mon, 18 Sep 2023 05:34:45 -0700 (PDT) Received: from ?IPV6:2003:cb:c74b:3400:ec51:7a3a:274e:cbee? (p200300cbc74b3400ec517a3a274ecbee.dip0.t-ipconnect.de. [2003:cb:c74b:3400:ec51:7a3a:274e:cbee]) by smtp.gmail.com with ESMTPSA id u20-20020a05600c211400b003fe1fe56202sm12327862wml.33.2023.09.18.05.34.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Sep 2023 05:34:44 -0700 (PDT) Message-ID: <930acbe1-942f-d10f-f33e-020693b60d6e@redhat.com> Date: Mon, 18 Sep 2023 14:34:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [RFC PATCH 3/9] Documentation/scrub-configure.rst: Add documentation for scrub driver To: Jonathan Cameron , linuxarm@huawei.com Cc: Shiju Jose , "linux-acpi@vger.kernel.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "rafael@kernel.org" , "lenb@kernel.org" , "naoya.horiguchi@nec.com" , "tony.luck@intel.com" , "james.morse@arm.com" , "dave.hansen@linux.intel.com" , "jiaqiyan@google.com" , "jthoughton@google.com" , "somasundaram.a@hpe.com" , "erdemaktas@google.com" , "pgonda@google.com" , "rientjes@google.com" , "duenwen@google.com" , "Vilas.Sridharan@amd.com" , "mike.malvestuto@intel.com" , "gthelen@google.com" , tanxiaofei , "Zengtao (B)" References: <20230915172818.761-1-shiju.jose@huawei.com> <20230915172818.761-4-shiju.jose@huawei.com> <887344ee-068d-f78f-d5f8-e816b966d875@redhat.com> <946f29d2370c41deb7a7c5a6f2bff0f3@huawei.com> <7282d074-15ba-4fe7-bf62-6a4dd6089817@redhat.com> <20230918132835.000031b7@huawei.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20230918132835.000031b7@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: AED9D1C0029 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 6dtxoqbiq5rcixtu1za9z7nmwpxdh9r9 X-HE-Tag: 1695040488-72221 X-HE-Meta: U2FsdGVkX19/kI978UA0kz3HVCqyCgWXcEgwexLQIl95dWPNXenLUj3Q0LKkslgW4TGU2MxqGkrEVkLOgKAEV+ALpH0c5GtpYx4SephSfVR3Er6v/4oWxn4ufhcLeGrBGwLg4HXKn4+ctp3OcK2mwKsJkugPDb8JXBd0N1AswXJe1jaB0QHiVx2nv771VWi5qydXpnZ6xMTitDfrUHLCep4fGugy+D5UAYOVDyK86OsIVvMQ/ajPxjzRXvBbRCCA3IACER28s9rvuICxTnGaAQeumbmU5Zb1ZCdDFQpxJdA2qLLHs7BhFMPpjO5Axmmmv4BWuiQ5+2/x7GrSHmKL2tb29T4uBNsq0B5O/yzp4p8z2erSHldNQSZA8Tkd8OCnxV5dZXjg/T2cBy82eOZp6QU/KrP8EpTCXJQJhwl3PYqY4aPHgkv9KCFxcnObSrPmrjodJS4KHPyDOjhyAFsmvl8pITdLf1n9ehJZM2ckRiMD3NtQHib6jwlx8nN3tmxh6AVEPkvQh0O+wNNWk5KdmLFMLOvj0JX0NELIqzK7fOC5kRPYuHxYO88RvREUzMIh9flyFUKp/ukcASTwUZrCMif7qof8nrwX4RHNsqFsK1ArR+V7zVmo76iPqq9IwGkvpw6FFZWJRPjv/YASVFkgkE16jFIuqdXTNaZHgyePY22KZw9x7V41I3SmDAqJ+f9aj2473Q9lvrXFANu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1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 18.09.23 14:28, Jonathan Cameron wrote: > On Mon, 18 Sep 2023 14:15:33 +0200 > David Hildenbrand wrote: > >> On 18.09.23 12:25, Shiju Jose wrote: >>> Hi David, >>> >>> Thanks for looking into this. >>> >>>> -----Original Message----- >>>> From: David Hildenbrand >>>> Sent: 18 September 2023 08:24 >>>> To: Shiju Jose ; linux-acpi@vger.kernel.org; linux- >>>> mm@kvack.org; linux-kernel@vger.kernel.org >>>> Cc: rafael@kernel.org; lenb@kernel.org; naoya.horiguchi@nec.com; >>>> tony.luck@intel.com; james.morse@arm.com; dave.hansen@linux.intel.com; >>>> jiaqiyan@google.com; jthoughton@google.com; somasundaram.a@hpe.com; >>>> erdemaktas@google.com; pgonda@google.com; rientjes@google.com; >>>> duenwen@google.com; Vilas.Sridharan@amd.com; mike.malvestuto@intel.com; >>>> gthelen@google.com; Linuxarm ; Jonathan Cameron >>>> ; tanxiaofei ; >>>> Zengtao (B) >>>> Subject: Re: [RFC PATCH 3/9] Documentation/scrub-configure.rst: Add >>>> documentation for scrub driver >>>> >>>> On 15.09.23 19:28, shiju.jose@huawei.com wrote: >>>>> From: Shiju Jose >>>>> >>>>> Add documentation for scrub driver, supports configure scrub >>>>> parameters, in Documentation/scrub-configure.rst >>>>> >>>>> Signed-off-by: Shiju Jose >>>>> --- >>>>> Documentation/scrub-configure.rst | 55 >>>> +++++++++++++++++++++++++++++++ >>>>> 1 file changed, 55 insertions(+) >>>>> create mode 100644 Documentation/scrub-configure.rst >>>>> >>>>> diff --git a/Documentation/scrub-configure.rst >>>>> b/Documentation/scrub-configure.rst >>>>> new file mode 100644 >>>>> index 000000000000..9f8581b88788 >>>>> --- /dev/null >>>>> +++ b/Documentation/scrub-configure.rst >>>>> @@ -0,0 +1,55 @@ >>>>> +========================== >>>>> +Scrub subsystem driver >>>>> +========================== >>>>> + >>>>> +Copyright (c) 2023 HiSilicon Limited. >>>>> + >>>>> +:Author: Shiju Jose >>>>> +:License: The GNU Free Documentation License, Version 1.2 >>>>> + (dual licensed under the GPL v2) :Original Reviewers: >>>>> + >>>>> +- Written for: 6.7 >>>>> +- Updated for: >>>>> + >>>>> +Introduction >>>>> +------------ >>>>> +The scrub subsystem driver provides the interface for configure the >>>> >>>> "... interface for configuring memory scrubbers in the system." >>>> >>>> are we only configuring firmware/hw-based memory scrubbing? I assume so. >>> The scrub control could be used for the SW based memory scrubbing too. >> >> Okay, looks like there is not too much hw/firmware specific in there >> (besides these weird range changes). >> [...] >> >>>>> +------- >>>>> + >>>>> + The usage takes the form shown in this example:: >>>>> + >>>>> + # echo 0x300000 > /sys/class/scrub/scrub0/region0/addr_base >>>>> + # echo 0x100000 > /sys/class/scrub/scrub0/region0/addr_size >>>>> + # cat /sys/class/scrub/scrub0/region0/speed_available >>>>> + # 1-60 >>>>> + # echo 25 > /sys/class/scrub/scrub0/region0/speed >>>>> + # echo 1 > /sys/class/scrub/scrub0/region0/enable >>>>> + >>>>> + # cat /sys/class/scrub/scrub0/region0/speed >>>>> + # 0x19 >>>> >>>> Is it reasonable to return the speed as hex? You set it as dec. >>> Presently return speed as hex to reduce the number of callback function needed >>> for reading the hex/dec data because the values for the address range >>> need to be in hex. >> >> If speed_available returns dec, speed better also return dec IMHO. >> >>> >>>> >>>>> + # cat /sys/class/scrub/scrub0/region0/addr_base >>>>> + # 0x100000 >>>> >>>> But didn't we set it to 0x300000 ... >>> This is an emulated example for testing the RASF/RAS2 definition. >>> According to the RASF & RAS2 definition, the actual address range in the >>> platform could vary from the requested address range for the patrol scrubbing. >>> "The platform calculates the nearest patrol scrub boundary address >>> from where it can start". The platform returns the actual address range >>> in response to GET_PATROL_PARAMETERS command to the firmware. >>> Please see section 5.2.21.2.1 Hardware-based Memory Scrubbing , >>> Table 5.87: Parameter Block Structure for PATROL_SCRUB in the >>> ACPI 6.5 specification. >>> >> >> So you configure [0x300000 - 0x400000] and you get [0x100000 - 0x300000] >> >> How does that make any sense? :) >> >> Shouldn't we rather return an error when setting a range that is >> impossible, instead of the hardware deciding to scrub something >> completely different (as can be seen in the example)? >> > > A broader scrub is probably reasonable, but agreed that scrubbing narrower > is 'interesting' as not scrubbing the memory requeseted. It's not even narrower. Both ranges don't even intersect! (sorry to say, but this configuration interface doesn't make any sense if hardware just does *something* else). If you can't configure it properly, fail with an error. > It's really annoying that neither ACPI table provides any proper > discoverability. Whilst we can fix that long term, we are stuck with > a clunky poke it and see interface in the meantime. Can't you set it, briefly enable it, and read the values back? Then, you can complain to the user that the configured range is impossible. -- Cheers, David / dhildenb