kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jingyi Wang <wangjingyi11@huawei.com>
To: <drjones@redhat.com>, <kvm@vger.kernel.org>,
	<kvmarm@lists.cs.columbia.edu>, <wangjingyi11@huawei.com>
Cc: <maz@kernel.org>, <wanghaibin.wang@huawei.com>,
	<yuzenghui@huawei.com>, <eric.auger@redhat.com>
Subject: [kvm-unit-tests PATCH 4/6] arm64: its: Handle its command queue wrapping
Date: Sun, 17 May 2020 18:08:58 +0800	[thread overview]
Message-ID: <20200517100900.30792-5-wangjingyi11@huawei.com> (raw)
In-Reply-To: <20200517100900.30792-1-wangjingyi11@huawei.com>

Because micro-bench may send a large number of ITS commands, we
should handle ITS command queue wrapping as kernel instead of just
failing the test.

Signed-off-by: Jingyi Wang <wangjingyi11@huawei.com>
---
 lib/arm64/gic-v3-its-cmd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/arm64/gic-v3-its-cmd.c b/lib/arm64/gic-v3-its-cmd.c
index 2c208d1..34574f7 100644
--- a/lib/arm64/gic-v3-its-cmd.c
+++ b/lib/arm64/gic-v3-its-cmd.c
@@ -164,8 +164,9 @@ static struct its_cmd_block *its_allocate_entry(void)
 {
 	struct its_cmd_block *cmd;
 
-	assert((u64)its_data.cmd_write < (u64)its_data.cmd_base + SZ_64K);
 	cmd = its_data.cmd_write++;
+	if ((u64)its_data.cmd_write  == (u64)its_data.cmd_base + SZ_64K)
+		its_data.cmd_write = its_data.cmd_base;
 	return cmd;
 }
 
-- 
2.19.1



  parent reply	other threads:[~2020-05-17 10:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 10:08 [kvm-unit-tests PATCH 0/6] arm64: add IPI/LPI/vtimer latency Jingyi Wang
2020-05-17 10:08 ` [kvm-unit-tests PATCH 1/6] arm64: microbench: get correct ipi recieved num Jingyi Wang
2020-05-21 14:00   ` Zenghui Yu
2020-05-22  2:32     ` Jingyi Wang
2020-05-22  5:34       ` Andrew Jones
2020-05-17 10:08 ` [kvm-unit-tests PATCH 2/6] arm64: microbench: Use the funcions for ipi test as the general functions for gic(ipi/lpi/timer) test Jingyi Wang
2020-05-17 10:08 ` [kvm-unit-tests PATCH 3/6] arm64: microbench: gic: Add gicv4.1 support for ipi latency test Jingyi Wang
2020-05-17 10:08 ` Jingyi Wang [this message]
2020-05-17 10:08 ` [kvm-unit-tests PATCH 5/6] arm64: microbench: its: Add LPI " Jingyi Wang
2020-05-17 10:09 ` [kvm-unit-tests PATCH 6/6] arm64: microbench: Add vtimer " Jingyi Wang
2020-05-18  7:05   ` Andrew Jones
2020-05-20  4:16     ` Jingyi Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200517100900.30792-5-wangjingyi11@huawei.com \
    --to=wangjingyi11@huawei.com \
    --cc=drjones@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=maz@kernel.org \
    --cc=wanghaibin.wang@huawei.com \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).