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 C6A0ECD37B0 for ; Mon, 18 Sep 2023 12:15:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 638516B0337; Mon, 18 Sep 2023 08:15:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E7F46B033D; Mon, 18 Sep 2023 08:15:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D71A6B0340; Mon, 18 Sep 2023 08:15:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3DD1E6B0337 for ; Mon, 18 Sep 2023 08:15:44 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 100801A0BDA for ; Mon, 18 Sep 2023 12:15:44 +0000 (UTC) X-FDA: 81249614208.29.80586F9 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf24.hostedemail.com (Postfix) with ESMTP id BC00E180009 for ; Mon, 18 Sep 2023 12:15:40 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fNhvWITb; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf24.hostedemail.com: domain of david@redhat.com designates 170.10.129.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=1695039340; 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=QLQP8ymBv8WYGYUV0p0EWAvpDFWaTDPT4dt30n9P+aU=; b=Rs7ynxlXGyVU6q1y+zTKvgpwJZFASG4Htb1cYRMeWplLKVsP6ZsNLY/BsEA5UopgDVAlOU qJAUwcgLRdNKyV6QlWuxigPHTrKQaiEm6NS09Wf5i51I35lTFonUMIYOj7gJMQgHf5jvlG 5hhKWlF3IBZhL4Hv7JVpFhCyJRcJAhQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=fNhvWITb; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf24.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1695039340; a=rsa-sha256; cv=none; b=1ggMnVvQPc0aNpKLG5pajTGme5sc47VdcL+vzswN7OGcKbLVtoBWdJAUiUi1GuYRb24JFy TelIdp2MDbJIXqDrASwwwU+8OUpNWWQmZb+BDggMkL0kQ0YOeA5F7R88QofwOEBEmUTK90 v8MAai3o+tWeR8qxab2axgQ7RncQorw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695039340; 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=QLQP8ymBv8WYGYUV0p0EWAvpDFWaTDPT4dt30n9P+aU=; b=fNhvWITbpJpMRAVcadV2BTvJeeuQeHzhgAvSTOLwCktqYxh21QuvnviLhS8uguH1e/QT0b RZz3kGd4bYnFOFPEKgdoA/Gxo05sO3WL3sIQ+Y59YL6YpEfIpPHKGNH5wKZArq8wc0M7Dr Wh3NxQk/J/hgPMzVbFB+oHyB6uqUDQU= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-591-7foZhq16NlCojksWbXESEw-1; Mon, 18 Sep 2023 08:15:36 -0400 X-MC-Unique: 7foZhq16NlCojksWbXESEw-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-320bf1de0a6so704484f8f.3 for ; Mon, 18 Sep 2023 05:15:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695039335; x=1695644135; 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=QLQP8ymBv8WYGYUV0p0EWAvpDFWaTDPT4dt30n9P+aU=; b=QRli9exVHk7mZnwC5YYpYR/5sRVubGNUW3lzaV9QiMlI7cAfdAnowZMzVB+IMJXT8Z ui0xQ1BqiBsFh9UeK+5eEXzXNimJGzl+4GIwJiC0QrsPcpi48L/1a1bhmSoc5gaW2bc8 lAB2pKwQrrRU8bhS2bLmD81kpYiquPHMfepsLrSi6yP65Te6rdadgVLOF5qg8cQMiAlU dYX3Wl4CyG9MAvzbPbFUgt3NlT1uIco0m1AqGKYOtQmi1qBCHeSsinKvsrBLMqpF34Au KN7zvFuj/U0PON3oeAk6+QNPBJb16yf0G88KWPJpYehAzbXcQOG9e2FPQFN/obvkZwmP +2xQ== X-Gm-Message-State: AOJu0YwXEff3CahdAct0bhK6KcI/QOLg+XHv4GOyoY7uHOfU8cZpdd27 HQGnbR05DDVQx5lYilQaqPj8Vc28b3+eD1wjm4OtEIa9kYt/KdLHlASdYyBgGOLKz+e9aFllXni 0w98OPm59vEM= X-Received: by 2002:adf:a3c4:0:b0:31f:f664:d87 with SMTP id m4-20020adfa3c4000000b0031ff6640d87mr6993018wrb.20.1695039335559; Mon, 18 Sep 2023 05:15:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiPzVINpDFunwk9RW0aGFYMYz2VP26Mb7bcSOQByHhJW+M0WEKDin38PjK49YHEn7Lq+uRxA== X-Received: by 2002:adf:a3c4:0:b0:31f:f664:d87 with SMTP id m4-20020adfa3c4000000b0031ff6640d87mr6992985wrb.20.1695039335149; Mon, 18 Sep 2023 05:15:35 -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 q30-20020adfab1e000000b003177074f830sm11029025wrc.59.2023.09.18.05.15.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Sep 2023 05:15:34 -0700 (PDT) Message-ID: <7282d074-15ba-4fe7-bf62-6a4dd6089817@redhat.com> Date: Mon, 18 Sep 2023 14:15:33 +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: 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)" 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> From: David Hildenbrand Organization: Red Hat In-Reply-To: <946f29d2370c41deb7a7c5a6f2bff0f3@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: BC00E180009 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 1aae4djt5p8713b4t9ao16ofuta7zaw7 X-HE-Tag: 1695039340-513140 X-HE-Meta: U2FsdGVkX19jW8VwNP0VTwYyebjTVoxGxkZW96UlLKkFoy6ysT29L8MMWoDNqr0JuZj1JznXMt0zithBxHUG4tm6ZT4KFB8kmIeGuUyT1EpJoCTSe8GL7dJ9W5N/JMhiUs+Ny0NzZ0/0oYoOs8JOX2kPs/7iTm+fMxhzmJvlGbvRmli8x58+ZqrTI3mDmV/BS0B23zsnsQJFk0oQCzhs3s/OrGzu9e18tlGEkFxAPdR9J02nFJUajEP20mD0X36T2zvOh/fe8f30aRviSeYIHWvw3FntwHhQOYZPxOp+6mLP6slwLr/1RA6VsEMZG+D9uH4gSsrMOGzw4eDzPRmKFo8bLPS4zwoe0nfuD6O1bc8hw/uL18CMO5AJYDPbAWi0W/tkssxofXe1/els3zydDMTgYcdVT5BnD++8ZI8hbNbuuY0yxNPBBy92gmlrVRrE1DVPU7rRpG8sFoHHITNImGm6xDCS3V5M2x4feh1xKhXEFRMBbfKxnq23NYM59s9ORFnkiypf3OZSFkilTEYq01rH5c1F7Hf3k1Dmda07mXWq6BmKBQyWQX7tSe4anN0sBItO5+DpfQjSuTJEUkHWcXap/u6bA+C+uCfubkJiuoH7pvJsy2IGVphAQVYdrLksdfoYVzpqMG7v3uor5FMb+8UllPr/rPMaAZg9kc3gaTiXI1SSZ+WqPa1nkXVoKygqgazAMg2ZBRq4TVnwhuuK6SSUcvmZi9PSxHF8YWGs/hkujNsO3KiqB22oL2GfayzvgD+CxHwXjcMyN3eo+peQn0J6ouEp7Dx34o2+PcvZnf6qvI021Hlxqj6KD+ElzSGg9HgOlup0IpMcGFXBV4iyoBKbN0FTBH/B8WKu3liPz3avE8qUrzld02bqaertPbUCF0baepxK8/nAIuRRdejwbxC83EFbvSuU7XBfuTe8UZiCr5IvTgiu2VOx+Jaf1VXbn5fpD1rfLU0jHP7tT9B Onay6ej5 OpFnVT1VHi8a6TKag5uXKnDEg0AqervM5DsVcwchz0Oe2Ftxi95WjY2MAK1cy9j96GSv5j45W3Er1lmEOTESnf/dzrYS1MDPluaaov6axy9g18mLHc8APmshqnAghbeFH4b1Xr+W1qgYWmyQCV7+lEzrnrou416U+PF0Wcyu75w/3ddWY1cOzqkPxZ4Evc7MOc1oDS0O22ECfX4ybwJo3eUuqmzy0Dk4KhaD1nA5BPC5Fh+D5SLmqNIynUsnIQkZsKjZ2pMT9JUL08ubFV2erUPI1YJniJeTr/ZyYKFjkV5XXEtb0PUUjGqyklg57y63jrO6ZQhJLsuBjnDkfyi3SgHmdzszHYrJAQ4CTmPAWxoy3QJ3onExclUN+SyA5XpP/1P9E7H7tlydL7T1WlfwU/Vk/Q3qoD4V9tmvWg4WpkDapAKK7d74P7j7fzOHVLboaXfdmBkf4k3VQTi0EmokX8UF0DGzxynJSOYIgt7e0j4NV3bFOZcuaIygy2K3Q3Ww74UgQKfi96MUkYGU0gjQx0lZZhCqu5J6cxOS86TzX5zTtu+gRbdP7uW8nLzVM9q7f2MXU6Pg1IbIvTeQ44kj9HeLKpvfWBwRlRGffmcUouWqrz+9siS3A5vAWqe9G03DjX4SAzNveojfIfa57V+pSlMzDfK5wHi6PwvFYkQAv8zUM+ost0aq79ikTcLxfUze/Jf8ogTAT1RqE/ya1efG7P6OxXBcaTZG/7TyyqnPJ9VCKtD5YSDyqBS6h9c4oA0Kbad2H X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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)? -- Cheers, David / dhildenb