[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH V3 01/11] x86/HV: Initialize GHCB page in Isolation VM
- To: Tianyu Lan <ltykernel@xxxxxxxxx>
- From: Christoph Hellwig <hch@xxxxxx>
- Date: Mon, 7 Jun 2021 08:41:42 +0200
- Cc: kys@xxxxxxxxxxxxx, haiyangz@xxxxxxxxxxxxx, sthemmin@xxxxxxxxxxxxx, wei.liu@xxxxxxxxxx, decui@xxxxxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, x86@xxxxxxxxxx, hpa@xxxxxxxxx, arnd@xxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, luto@xxxxxxxxxx, peterz@xxxxxxxxxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, kirill.shutemov@xxxxxxxxxxxxxxx, rppt@xxxxxxxxxx, hannes@xxxxxxxxxxx, cai@xxxxxx, krish.sadhukhan@xxxxxxxxxx, saravanand@xxxxxx, Tianyu.Lan@xxxxxxxxxxxxx, konrad.wilk@xxxxxxxxxx, hch@xxxxxx, m.szyprowski@xxxxxxxxxxx, robin.murphy@xxxxxxx, boris.ostrovsky@xxxxxxxxxx, jgross@xxxxxxxx, sstabellini@xxxxxxxxxx, joro@xxxxxxxxxx, will@xxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, davem@xxxxxxxxxxxxx, kuba@xxxxxxxxxx, jejb@xxxxxxxxxxxxx, martin.petersen@xxxxxxxxxx, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, linux-hyperv@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, vkuznets@xxxxxxxxxx, thomas.lendacky@xxxxxxx, brijesh.singh@xxxxxxx, sunilmut@xxxxxxxxxxxxx
- Delivery-date: Mon, 07 Jun 2021 06:41:54 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Sun, May 30, 2021 at 11:06:18AM -0400, Tianyu Lan wrote:
> + if (ms_hyperv.ghcb_base) {
> + rdmsrl(MSR_AMD64_SEV_ES_GHCB, ghcb_gpa);
> +
> + ghcb_va = ioremap_cache(ghcb_gpa, HV_HYP_PAGE_SIZE);
> + if (!ghcb_va)
> + return -ENOMEM;
Can you explain this a bit more? We've very much deprecated
ioremap_cache in favor of memremap. Why yo you need a __iomem address
here? Why do we need the remap here at all?
Does the data structure at this address not have any types that we
could use a struct for?
> +
> + rdmsrl(MSR_AMD64_SEV_ES_GHCB, ghcb_gpa);
> + ghcb_va = ioremap_cache(ghcb_gpa, HV_HYP_PAGE_SIZE);
> + if (!ghcb_va) {
This seems to duplicate the above code.
> +bool hv_isolation_type_snp(void)
> +{
> + return static_branch_unlikely(&isolation_type_snp);
> +}
> +EXPORT_SYMBOL_GPL(hv_isolation_type_snp);
This probably wants a kerneldoc explaining when it should be used.
|