From: Zenghui Yu <yuzenghui@huawei.com>
To: Eric Auger <eric.auger@redhat.com>, <eric.auger.pro@gmail.com>,
<maz@kernel.org>, <kvmarm@lists.cs.columbia.edu>,
<kvm@vger.kernel.org>, <qemu-devel@nongnu.org>,
<qemu-arm@nongnu.org>
Cc: <drjones@redhat.com>, <andre.przywara@arm.com>,
<peter.maydell@linaro.org>, <alexandru.elisei@arm.com>,
<thuth@redhat.com>
Subject: Re: [kvm-unit-tests PATCH v6 10/13] arm/arm64: ITS: INT functional tests
Date: Fri, 13 Mar 2020 10:06:20 +0800 [thread overview]
Message-ID: <7d79cc12-acdb-ff56-594d-3fa830f7d053@huawei.com> (raw)
In-Reply-To: <20200311135117.9366-11-eric.auger@redhat.com>
On 2020/3/11 21:51, Eric Auger wrote:
> +static void test_its_trigger(void)
> +{
> + struct its_collection *col3, *col2;
> + struct its_device *dev2, *dev7;
> +
> + if (its_prerequisites(4))
> + return;
> +
> + dev2 = its_create_device(2 /* dev id */, 8 /* nb_ites */);
> + dev7 = its_create_device(7 /* dev id */, 8 /* nb_ites */);
> +
> + col3 = its_create_collection(3 /* col id */, 3/* target PE */);
> + col2 = its_create_collection(2 /* col id */, 2/* target PE */);
> +
> + gicv3_lpi_set_config(8195, LPI_PROP_DEFAULT);
> + gicv3_lpi_set_config(8196, LPI_PROP_DEFAULT);
> +
> + report_prefix_push("int");
> + /*
> + * dev=2, eventid=20 -> lpi= 8195, col=3
> + * dev=7, eventid=255 -> lpi= 8196, col=2
> + * Trigger dev2, eventid=20 and dev7, eventid=255
> + * Check both LPIs hit
> + */
> +
> + its_send_mapd(dev2, true);
> + its_send_mapd(dev7, true);
> +
> + its_send_mapc(col3, true);
> + its_send_mapc(col2, true);
> +
> + its_send_invall(col2);
> + its_send_invall(col3);
> +
> + its_send_mapti(dev2, 8195 /* lpi id */, 20 /* event id */, col3);
> + its_send_mapti(dev7, 8196 /* lpi id */, 255 /* event id */, col2);
> +
> + lpi_stats_expect(3, 8195);
> + its_send_int(dev2, 20);
> + check_lpi_stats("dev=2, eventid=20 -> lpi= 8195, col=3");
> +
> + lpi_stats_expect(2, 8196);
> + its_send_int(dev7, 255);
> + check_lpi_stats("dev=7, eventid=255 -> lpi= 8196, col=2");
> +
> + report_prefix_pop();
> +
> + report_prefix_push("inv/invall");
> +
> + /*
> + * disable 8195, check dev2/eventid=20 does not trigger the
> + * corresponding LPI
> + */
> + gicv3_lpi_set_config(8195, LPI_PROP_DEFAULT & ~LPI_PROP_ENABLED);
> + its_send_inv(dev2, 20);
> +
> + lpi_stats_expect(-1, -1);
> + its_send_int(dev2, 20);
> + check_lpi_stats("dev2/eventid=20 does not trigger any LPI");
> +
> + /*
> + * re-enable the LPI but willingly do not call invall
> + * so the change in config is not taken into account.
> + * The LPI should not hit
> + */
> + gicv3_lpi_set_config(8195, LPI_PROP_DEFAULT);
> + lpi_stats_expect(-1, -1);
> + its_send_int(dev2, 20);
> + check_lpi_stats("dev2/eventid=20 still does not trigger any LPI");
> +
> + /* Now call the invall and check the LPI hits */
> + its_send_invall(col3);
> + lpi_stats_expect(3, 8195);
> + its_send_int(dev2, 20);
> + check_lpi_stats("dev2/eventid=20 now triggers an LPI");
> +
> + report_prefix_pop();
> +
> + report_prefix_push("mapd valid=false");
> + /*
> + * Unmap device 2 and check the eventid 20 formerly
> + * attached to it does not hit anymore
> + */
> +
> + its_send_mapd(dev2, false);
> + lpi_stats_expect(-1, -1);
> + its_send_int(dev2, 20);
Here. You issued an INT command while the dev2 has just been unmapped,
this will be detected by ITS as a command error. We may end-up failed
to see the completion of this command (under the ITS stall mode).
Thanks,
Zenghui
> + check_lpi_stats("no LPI after device unmap");
> + report_prefix_pop();
> +}
next prev parent reply other threads:[~2020-03-13 2:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 13:51 [kvm-unit-tests PATCH v6 00/13] arm/arm64: Add ITS tests Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 01/13] libcflat: Add other size defines Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 02/13] page_alloc: Introduce get_order() Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 03/13] arm/arm64: gic: Introduce setup_irq() helper Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 04/13] arm/arm64: gicv3: Add some re-distributor defines Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 05/13] arm/arm64: gicv3: Set the LPI config and pending tables Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 06/13] arm/arm64: ITS: Introspection tests Eric Auger
2020-03-11 14:33 ` Andrew Jones
2020-03-11 14:50 ` Auger Eric
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 07/13] arm/arm64: ITS: its_enable_defaults Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 08/13] arm/arm64: ITS: Device and collection Initialization Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 09/13] arm/arm64: ITS: Commands Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 10/13] arm/arm64: ITS: INT functional tests Eric Auger
2020-03-13 2:06 ` Zenghui Yu [this message]
2020-03-13 8:17 ` Auger Eric
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 11/13] arm/run: Allow Migration tests Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 12/13] arm/arm64: ITS: migration tests Eric Auger
2020-03-11 13:51 ` [kvm-unit-tests PATCH v6 13/13] arm/arm64: ITS: pending table migration test Eric Auger
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=7d79cc12-acdb-ff56-594d-3fa830f7d053@huawei.com \
--to=yuzenghui@huawei.com \
--cc=alexandru.elisei@arm.com \
--cc=andre.przywara@arm.com \
--cc=drjones@redhat.com \
--cc=eric.auger.pro@gmail.com \
--cc=eric.auger@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=maz@kernel.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.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).