[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [kvm-unit-tests PATCH v7 06/13] arm/arm64: ITS: Introspection tests
From: |
Andrew Jones |
Subject: |
Re: [kvm-unit-tests PATCH v7 06/13] arm/arm64: ITS: Introspection tests |
Date: |
Mon, 30 Mar 2020 11:11:39 +0200 |
On Mon, Mar 30, 2020 at 10:46:57AM +0200, Auger Eric wrote:
> Hi Zenghui,
>
> On 3/30/20 10:30 AM, Zenghui Yu wrote:
> > Hi Eric,
> >
> > On 2020/3/20 17:24, Eric Auger wrote:
> >> +static void its_cmd_queue_init(void)
> >> +{
> >> + unsigned long order = get_order(SZ_64K >> PAGE_SHIFT);
> >> + u64 cbaser;
> >> +
> >> + its_data.cmd_base = (void *)virt_to_phys(alloc_pages(order));
> >
> > Shouldn't the cmd_base (and the cmd_write) be set as a GVA?
> yes it should
If it's supposed to be a virtual address, when why do the virt_to_phys?
> >
> > Otherwise I think we will end-up with memory corruption when writing
> > the command queue. But it seems that everything just works fine ...
> > So I'm really confused here :-/
> I was told by Paolo that the VA/PA memory map is flat in kvmunit test.
What does flat mean? kvm-unit-tests, at least arm/arm64, does prepare
an identity map of all physical memory, which explains why the above
is working. It's doing virt_to_phys(some-virt-addr), which gets a
phys addr, but when the ITS uses it as a virt addr it works because
we *also* have a virt addr == phys addr mapping in the default page
table, which is named "idmap" for good reason.
I think it would be better to test with the non-identity mapped addresses
though.
Thanks,
drew
>
> >
> >> +
> >> + cbaser = ((u64)its_data.cmd_base | (SZ_64K / SZ_4K - 1) |
> >> GITS_CBASER_VALID);
> >> +
> >> + writeq(cbaser, its_data.base + GITS_CBASER);
> >> +
> >> + its_data.cmd_write = its_data.cmd_base;
> >> + writeq(0, its_data.base + GITS_CWRITER);
> >> +}
> >
> > Otherwise this looks good,
> > Reviewed-by: Zenghui Yu <address@hidden>
> Thanks!
>
> Eric
> >
> >
> > Thanks
> >
>
>
- [kvm-unit-tests PATCH v7 00/13] arm/arm64: Add ITS tests, Eric Auger, 2020/03/20
- [kvm-unit-tests PATCH v7 01/13] libcflat: Add other size defines, Eric Auger, 2020/03/20
- [kvm-unit-tests PATCH v7 02/13] page_alloc: Introduce get_order(), Eric Auger, 2020/03/20
- [kvm-unit-tests PATCH v7 03/13] arm/arm64: gic: Introduce setup_irq() helper, Eric Auger, 2020/03/20
- [kvm-unit-tests PATCH v7 04/13] arm/arm64: gicv3: Add some re-distributor defines, Eric Auger, 2020/03/20
- [kvm-unit-tests PATCH v7 05/13] arm/arm64: gicv3: Set the LPI config and pending tables, Eric Auger, 2020/03/20
- [kvm-unit-tests PATCH v7 06/13] arm/arm64: ITS: Introspection tests, Eric Auger, 2020/03/20
- Re: [kvm-unit-tests PATCH v7 06/13] arm/arm64: ITS: Introspection tests, Zenghui Yu, 2020/03/30
[kvm-unit-tests PATCH v7 07/13] arm/arm64: ITS: its_enable_defaults, Eric Auger, 2020/03/20
[kvm-unit-tests PATCH v7 08/13] arm/arm64: ITS: Device and collection Initialization, Eric Auger, 2020/03/20
[kvm-unit-tests PATCH v7 09/13] arm/arm64: ITS: Commands, Eric Auger, 2020/03/20