[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v2 3/6] x86/hvm/domain: remove the 'hap_enabled' flag
- To: Paul Durrant <paul.durrant@xxxxxxxxxx>
- From: Jan Beulich <JBeulich@xxxxxxxx>
- Date: Mon, 29 Jul 2019 14:35:46 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=suse.com;dmarc=pass action=none header.from=suse.com;dkim=pass header.d=suse.com;arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cL8+1oahNVOqJA+5J6p3EX9Ow2nhBiR68VgVAMLdZUM=; b=DTRcCuA25f8vE6tjNXZSNM46tV7Od2XFjAYJ6TL6KMfFGczfxs1ULUSNB91GmwiUo4dkdPPRqYOBsGrRrxL02rYZOPWZ6gxn8we5Rwqu2J/bf1DCug4PKrQFh14q/XVtuMXaP9zyuL1VNX0lqkpCwTna+sWLHcKEbgLsqVsDIqY/Zdj+3ZHxDiqoEWi0Cut7YRRZlEN3WDailj8WhOMFNlG1Ggc4EtfA6MmiBdGcrpXVJDVrmcpbZ9oeiXal3jE5mctfDwgBIfUCih9at48JmSMLUkP9U/znl8en/N2lMxFmZk6Ng9ahTqJNjEUBnzMEiAdhRvmQrBt4fuPk5QopuA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ixatg4K8l05EwA52xw0tsu1gaL52Y/7JRySwtP38741vMLbNNVkRp2/efLNF1gmSI19UNe73B/KUXrR4ZnBlofhrljnE8oTs8vBF0/B7bo+wyyRQ9pJ40VVQwTFWHFysV4bL352cCkw80uZAw40YdQhNU1rURAera3HVGWYfHSa0KdMnOZZRbCOHVP0nlgphxXGUh3U4bJGjEaaJD5AVWI/c83z7PO2I5mytSBum8R154gfcJr3duM0KkoXjAsmNTCLaRUb+2YLHV6oWvzFBGUgTD+tu34UtqPMszYwcZY4/jmiapg47q1S+OQh5/ycJjTFDy6vHDSyBpruAqWtMlw==
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Delivery-date: Mon, 29 Jul 2019 14:53:55 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHVQu5vz1VKdPiVUEavBBqvCluqW6bhr+wA
- Thread-topic: [PATCH v2 3/6] x86/hvm/domain: remove the 'hap_enabled' flag
On 25.07.2019 15:39, Paul Durrant wrote:
> @@ -195,11 +194,9 @@ struct hvm_domain {
> };
> };
>
> -#ifdef CONFIG_HVM
> -#define hap_enabled(d) (is_hvm_domain(d) && (d)->arch.hvm.hap_enabled)
> -#else
> -#define hap_enabled(d) ({(void)(d); false;})
> -#endif
> +#define hap_enabled(d) \
> + (hvm_hap_supported() && is_hvm_domain(d) && \
> + evaluate_nospec(d->options & XEN_DOMCTL_CDF_hap))
Rather than adding yet another && here I think you want to
reject XEN_DOMCTL_CDF_hap in arch_sanitise_domain_config()
when !hvm_hap_supported(). Similarly the is_hvm_domain()
could then also be eliminated by checking that CDF_hap is
set only together with CDF_hvm (or by clearing CDF_hap if
CDF_hvm is clear - depends on what compatibility needs
there are.
This would then also eliminate the double evaluation of
"d".
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|