From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B943F606A320 for ; Sun, 22 Nov 2026 11:58:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=HQqygU6s; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=lTGcvsZl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=q7p2UotUK+VH4X+parafh/ByB7Uc84AHmsitfJ5mBEQ=; b=HQqygU6sgBSaxsKgqgTlRGGQxr tD4pSIA6oEiBrxuJ7TqCEF5EoK4J2aKeK3E0bPPid15QSCtNAhsY2z46u3ZKXMxdjpcEFRHU7PeYs BQ9gMMbhzxGfTTk5llvJWrAc4c0F1IRuy1Hs1dgU3EzDmGpT7Z4oEV9KbtEQmdx9ZUCxcTdTkrD4x EwA5YpmOnkNnv11Vz45PtIvDv/MQAFj3qkKQeUI9Bodu8VDjKQXAicbYEyLk4Adaft+B4zRADcNYC KSeEdpDcSN49Ggd21UTWKsUa4L1w0BmNc13+EXqADpqlQvQKF2lAlRHOQuOyALIJcdEHfTqUFbN6Q YCPyL3uQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xV6Db-000000013gu-1vik; Sun, 22 Nov 2026 11:58:51 +0000 Received: from out-106.mta0.migadu.com ([2001:41d0:1004:224b::6a] helo=mta0.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xV6DX-000000013fH-2SKh for kvm-riscv@lists.infradead.org; Sun, 22 Nov 2026 11:58:49 +0000 X-Envelope-To: kvm-riscv@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=ryWXKdGt6pMawUrYdr9GJQTC4h6r7TQ0FZPjcUKLboQ=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795348725; v=1; x=1795953525; b=lTGcvsZl2sArPgA+ta3CyzG47TBmyuWxJBWLP2MkHV5ctRQuXNbPB36oC1DAUckSqkj9ih2U jEHXxhZdwbb30nWZyTgHjm2ULCJ0B3dxwmld+4iPEW6WVJs/iUpC4X8tjzvlzmajETiuax4ePCm r3nT4z9X93D3qH9i00jxAKXE= X-Envelope-To: kvm-riscv@lists.infradead.org Received: by smtp.migadu.com with ESMTPS id 61aa96329a398c95; Sun, 22 Nov 2026 11:58:45 +0000 X-Mizu-Trace-ID: 61aa96329a398c95 X-Migadu-Flow: FLOW_OUT Date: Sun, 22 Nov 2026 12:58:10 +0100 From: Andrew Jones To: Koichiro Den Cc: Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Bingyu Xian , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] RISC-V: KVM: Batch user accesses when updating steal time Message-ID: References: <20261121173526.892344-1-den@valinux.co.jp> <20261121173526.892344-3-den@valinux.co.jp> X-Archived-By: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20261121173526.892344-3-den@valinux.co.jp> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261122_035848_306581_9E104B12 X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kvm-riscv" X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Sun, Nov 22, 2026 at 02:35:25AM +0900, Koichiro Den wrote: > Updating the SBI STA shared structure performs 2x get_user() + 3x > put_user() calls, each of which toggles sstatus.SUM. > > Keep SUM enabled across all five accesses to the shared structure. > > Signed-off-by: Koichiro Den > --- > Changes since v1: > - Drop might_fault(). (Andrew) > - Use scoped_user_rw_access(). (Andrew) > - Use le32_add_cpu() and le64_add_cpu() to avoid the extra temporaries. > > Note: > - I haven't carried over Andrew's Reviewed-by since the scoped_ > conversion reworks the fault paths. Would appreciate another look. > - As in v1, I kept WARN_ON() for uaccess failures. > > v1: https://lore.kernel.org/r/20261118062242.2914385-2-den@valinux.co.jp/ > > arch/riscv/kvm/vcpu_sbi_sta.c | 60 +++++++++++++++++------------------ > 1 file changed, 30 insertions(+), 30 deletions(-) > Reviewed-by: Andrew Jones -- kvm-riscv mailing list kvm-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kvm-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.16 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795348728; b=wgLoqe6QpqwluKuNHaFXQeUiMUkGH9BYPSpq7QreiJAiHYfBdKbz/JcmHoA9TjFZ6x9p 28BcdEke6YXw4+R/656MoG8Fuc6fxrpojiqh2F/qdNX/Bq1XMeQZp4po1miJDmDZNn6oN hI4+V7zJJpMGk/fNVL5wJ5daMJHtHRjk+JCuajj2tls5s4AEOwG3kWk1s4Ybg6tQa5gSd TdNVv7GtHRMq2SFzyaA0V1w+PhjGOyDxkpTx0XvB7QSAd7Bw65atXHgsepSzynIxlbqxP JEB5MMH9aVBqGE2m1+G4w6w1QVjH63BS/OIlGC3AbbHyt/U2cif6qvJjT8YPvm9UbTQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795348728; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=B6gRmrMmIeT6PDLP4jdr2d+FZm74h0ydQ3whXPdu6CU=; b=yvM/ypR6dXw722qiBfukQRLZairHxKU/c9nZbMgF4l+yxvWLy0dMEo7MCa29ubLvaTKD iTY00ORDgVacJ2WVSq1bC2AQjlUV0bnoyeEta9RRNXi1jVZb+T6Ws1oFIb/2L2R8DS2AR CgOOLiVefISH9p7V0MZ/7Oodwejir18416pTl6L3nCWDoQXhtFHFXKxjToyfa1+k9adrX 0SJV1Mo8M1lUXH0q5uHhaAu7E0O2yJaXUHqisizcjG9Pb3VuMiYDD/PG22T7pVHjYWi6m d2jq1rTu1R5ZpbCb7KwETol5xpwgRi41AIPz2gMyWiTjbTAWNT2DPRsOwvNgfuHWsIA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=lTGcvsZl; arc=none smtp.remote-ip=91.218.175.16 Received: from mta0.migadu.com (out-16.mta0.migadu.com [91.218.175.16]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B753606A320 for ; Sun, 22 Nov 2026 11:58:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6B753606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=lTGcvsZl X-Envelope-To: kvm@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=ryWXKdGt6pMawUrYdr9GJQTC4h6r7TQ0FZPjcUKLboQ=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795348725; v=1; x=1795953525; b=lTGcvsZl2sArPgA+ta3CyzG47TBmyuWxJBWLP2MkHV5ctRQuXNbPB36oC1DAUckSqkj9ih2U jEHXxhZdwbb30nWZyTgHjm2ULCJ0B3dxwmld+4iPEW6WVJs/iUpC4X8tjzvlzmajETiuax4ePCm r3nT4z9X93D3qH9i00jxAKXE= X-Envelope-To: kvm@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id 61aa96329a398c95; Sun, 22 Nov 2026 11:58:45 +0000 X-Mizu-Trace-ID: 61aa96329a398c95 X-Migadu-Flow: FLOW_OUT Date: Sun, 22 Nov 2026 12:58:10 +0100 From: Andrew Jones To: Koichiro Den Cc: Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Bingyu Xian , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] RISC-V: KVM: Batch user accesses when updating steal time Message-ID: References: <20261121173526.892344-1-den@valinux.co.jp> <20261121173526.892344-3-den@valinux.co.jp> X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261121173526.892344-3-den@valinux.co.jp> On Sun, Nov 22, 2026 at 02:35:25AM +0900, Koichiro Den wrote: > Updating the SBI STA shared structure performs 2x get_user() + 3x > put_user() calls, each of which toggles sstatus.SUM. > > Keep SUM enabled across all five accesses to the shared structure. > > Signed-off-by: Koichiro Den > --- > Changes since v1: > - Drop might_fault(). (Andrew) > - Use scoped_user_rw_access(). (Andrew) > - Use le32_add_cpu() and le64_add_cpu() to avoid the extra temporaries. > > Note: > - I haven't carried over Andrew's Reviewed-by since the scoped_ > conversion reworks the fault paths. Would appreciate another look. > - As in v1, I kept WARN_ON() for uaccess failures. > > v1: https://lore.kernel.org/r/20261118062242.2914385-2-den@valinux.co.jp/ > > arch/riscv/kvm/vcpu_sbi_sta.c | 60 +++++++++++++++++------------------ > 1 file changed, 30 insertions(+), 30 deletions(-) > Reviewed-by: Andrew Jones From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 195DA606A320 for ; Sun, 22 Nov 2026 11:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=mmImANiZ; dkim=fail reason="signature verification failed" (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=lTGcvsZl DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=zg8Q9GVD3u3JcTGGmfuwwPWiyd26a2qBUUErP5EmDFw=; b=mmImANiZoGkM2fRhuJmK7yW//g BE/YsxHz/hwiQ7sSlBG2STPJ/L8zBTvLPUTWSb8qWIyXiheHlRZPMOXERXgi0B5jEI5Ihfmkog9DJ +ZlnmkPeE9OAVBtYbHdaY8ANVBzNJzWTo0fww+DPGYQa0r+IAw3JnE/ccRO53YkWrqKKIIoBTxv06 XV6ru/ztHUP0Gz4o+PFLt0XUvkNTHWuSoCzqWN5v2xPd+4qoq4olcvAVOzF9B5kLbR5aVkFBVUmIP JEoxz/9MHo4SQ1gsTAVhgz5HnAprd2JbYZqHKcvq5sc7RfntgL0XljLx6IsmlZ+sQBIQp3QHZssF7 keoXxDGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xV6Dc-000000013hH-2GNr; Sun, 22 Nov 2026 11:58:54 +0000 Received: from out-105.mta0.migadu.com ([2001:41d0:1004:224b::69] helo=mta0.migadu.com) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xV6DX-000000013fG-2SME for linux-riscv@lists.infradead.org; Sun, 22 Nov 2026 11:58:50 +0000 X-Envelope-To: linux-riscv@lists.infradead.org DKIM-Signature: a=rsa-sha256; bh=ryWXKdGt6pMawUrYdr9GJQTC4h6r7TQ0FZPjcUKLboQ=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1795348725; v=1; x=1795953525; b=lTGcvsZl2sArPgA+ta3CyzG47TBmyuWxJBWLP2MkHV5ctRQuXNbPB36oC1DAUckSqkj9ih2U jEHXxhZdwbb30nWZyTgHjm2ULCJ0B3dxwmld+4iPEW6WVJs/iUpC4X8tjzvlzmajETiuax4ePCm r3nT4z9X93D3qH9i00jxAKXE= X-Envelope-To: linux-riscv@lists.infradead.org Received: by smtp.migadu.com with ESMTPS id 61aa96329a398c95; Sun, 22 Nov 2026 11:58:45 +0000 X-Mizu-Trace-ID: 61aa96329a398c95 X-Migadu-Flow: FLOW_OUT Date: Sun, 22 Nov 2026 12:58:10 +0100 From: Andrew Jones To: Koichiro Den Cc: Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Bingyu Xian , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/3] RISC-V: KVM: Batch user accesses when updating steal time Message-ID: References: <20261121173526.892344-1-den@valinux.co.jp> <20261121173526.892344-3-den@valinux.co.jp> X-Archived-By: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20261121173526.892344-3-den@valinux.co.jp> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261122_035848_318866_BB13AF83 X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Sun, Nov 22, 2026 at 02:35:25AM +0900, Koichiro Den wrote: > Updating the SBI STA shared structure performs 2x get_user() + 3x > put_user() calls, each of which toggles sstatus.SUM. > > Keep SUM enabled across all five accesses to the shared structure. > > Signed-off-by: Koichiro Den > --- > Changes since v1: > - Drop might_fault(). (Andrew) > - Use scoped_user_rw_access(). (Andrew) > - Use le32_add_cpu() and le64_add_cpu() to avoid the extra temporaries. > > Note: > - I haven't carried over Andrew's Reviewed-by since the scoped_ > conversion reworks the fault paths. Would appreciate another look. > - As in v1, I kept WARN_ON() for uaccess failures. > > v1: https://lore.kernel.org/r/20261118062242.2914385-2-den@valinux.co.jp/ > > arch/riscv/kvm/vcpu_sbi_sta.c | 60 +++++++++++++++++------------------ > 1 file changed, 30 insertions(+), 30 deletions(-) > Reviewed-by: Andrew Jones _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv