Re: [kvm-unit-tests PATCH v7 08/11] x86: AMD SEV-ES: Handle CPUID #VC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 19, 2024, vsntk18@xxxxxxxxx wrote:
> +static inline void sev_es_wr_ghcb_msr(u64 val)
> +{
> +	wrmsr(MSR_AMD64_SEV_ES_GHCB, val);
> +}
> +
> +static inline u64 sev_es_rd_ghcb_msr(void)
> +{
> +	return rdmsr(MSR_AMD64_SEV_ES_GHCB);
> +}

These are silly, they just add a layer of obfuscation.  It's just as easy to do:

	wrmsr(MSR_AMD64_SEV_ES_GHCB, __pa(ghcb));

> +
> +

Extra newline.

> +static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb,
> +					  struct es_em_ctxt *ctxt,
> +					  u64 exit_code, u64 exit_info_1,
> +					  u64 exit_info_2)
> +{
> +	enum es_result ret;
> +
> +	/* Fill in protocol and format specifiers */
> +	ghcb->version = GHCB_VERSION;
> +	ghcb->ghcb_usage       = GHCB_DEFAULT_USAGE;
> +
> +	ghcb_set_sw_exit_code(ghcb, exit_code);
> +	ghcb_set_sw_exit_info_1(ghcb, exit_info_1);
> +	ghcb_set_sw_exit_info_2(ghcb, exit_info_2);
> +
> +	sev_es_wr_ghcb_msr(__pa(ghcb));




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux