Xen-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [Xen-devel] [PATCH] x86/hvm: Fix the use of "hap=0" following c/s c0902a9a143a
@ 2019-10-09 18:21 Andrew Cooper
  2019-10-09 18:56 ` Paul Durrant
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andrew Cooper @ 2019-10-09 18:21 UTC (permalink / raw)
  To: Xen-devel
  Cc: Juergen Gross, Wei Liu, Paul Durrant, Andrew Cooper, Jan Beulich,
	Roger Pau Monné

c/s c0902a9a143a refactored hvm_enable() a little, but dropped the logic which
cleared hap_supported in the case that the user had asked for it off.

This results in Xen booting up, claiming:

  (XEN) HVM: Hardware Assisted Paging (HAP) detected but disabled

but with HAP advertised via sysctl, and XEN_DOMCTL_CDF_hap being accepted in
domain_create().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Paul Durrant <paul@xen.org>
CC: Juergen Gross <jgross@suse.com>

This is a regression from 4.12, so should be fixed before 4.13 ships.
---
 xen/arch/x86/hvm/hvm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index c22cb39cf3..9acd359c99 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -142,7 +142,7 @@ static struct notifier_block cpu_nfb = {
     .notifier_call = cpu_callback
 };
 
-static bool __init hap_supported(const struct hvm_function_table *fns)
+static bool __init hap_supported(struct hvm_function_table *fns)
 {
     if ( !fns->hap_supported )
     {
@@ -152,6 +152,7 @@ static bool __init hap_supported(const struct hvm_function_table *fns)
 
     if ( !opt_hap_enabled )
     {
+        fns->hap_supported = 0;
         printk("HVM: Hardware Assisted Paging (HAP) detected but disabled\n");
         return false;
     }
@@ -175,7 +176,7 @@ static int __init hvm_enable(void)
     hvm_enabled = 1;
 
     printk("HVM: %s enabled\n", fns->name);
-    if ( !hap_supported(fns) )
+    if ( !hap_supported(&hvm_funcs) )
         clear_iommu_hap_pt_share();
     else
     {
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [PATCH] x86/hvm: Fix the use of "hap=0" following c/s c0902a9a143a
  2019-10-09 18:21 [Xen-devel] [PATCH] x86/hvm: Fix the use of "hap=0" following c/s c0902a9a143a Andrew Cooper
@ 2019-10-09 18:56 ` Paul Durrant
  2019-10-10  7:06   ` Jan Beulich
  2019-10-09 19:05 ` Wei Liu
  2019-10-10  4:19 ` Jürgen Groß
  2 siblings, 1 reply; 5+ messages in thread
From: Paul Durrant @ 2019-10-09 18:56 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Juergen Gross, Wei Liu, Paul Durrant, Jan Beulich, Xen-devel,
	Roger Pau Monné

On Wed, 9 Oct 2019 at 19:21, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> c/s c0902a9a143a refactored hvm_enable() a little, but dropped the logic which
> cleared hap_supported in the case that the user had asked for it off.
>
> This results in Xen booting up, claiming:
>
>   (XEN) HVM: Hardware Assisted Paging (HAP) detected but disabled
>
> but with HAP advertised via sysctl, and XEN_DOMCTL_CDF_hap being accepted in
> domain_create().
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

That should have been largely code movement, so I don't know how I
managed to drop that.

Reviewed-by: Paul Durrant <paul@xen.org>

> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Wei Liu <wl@xen.org>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Paul Durrant <paul@xen.org>
> CC: Juergen Gross <jgross@suse.com>
>
> This is a regression from 4.12, so should be fixed before 4.13 ships.
> ---
>  xen/arch/x86/hvm/hvm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index c22cb39cf3..9acd359c99 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -142,7 +142,7 @@ static struct notifier_block cpu_nfb = {
>      .notifier_call = cpu_callback
>  };
>
> -static bool __init hap_supported(const struct hvm_function_table *fns)
> +static bool __init hap_supported(struct hvm_function_table *fns)
>  {
>      if ( !fns->hap_supported )
>      {
> @@ -152,6 +152,7 @@ static bool __init hap_supported(const struct hvm_function_table *fns)
>
>      if ( !opt_hap_enabled )
>      {
> +        fns->hap_supported = 0;
>          printk("HVM: Hardware Assisted Paging (HAP) detected but disabled\n");
>          return false;
>      }
> @@ -175,7 +176,7 @@ static int __init hvm_enable(void)
>      hvm_enabled = 1;
>
>      printk("HVM: %s enabled\n", fns->name);
> -    if ( !hap_supported(fns) )
> +    if ( !hap_supported(&hvm_funcs) )
>          clear_iommu_hap_pt_share();
>      else
>      {
> --
> 2.11.0
>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [PATCH] x86/hvm: Fix the use of "hap=0" following c/s c0902a9a143a
  2019-10-09 18:21 [Xen-devel] [PATCH] x86/hvm: Fix the use of "hap=0" following c/s c0902a9a143a Andrew Cooper
  2019-10-09 18:56 ` Paul Durrant
@ 2019-10-09 19:05 ` Wei Liu
  2019-10-10  4:19 ` Jürgen Groß
  2 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2019-10-09 19:05 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Juergen Gross, Wei Liu, Paul Durrant, Jan Beulich, Xen-devel,
	Roger Pau Monné

On Wed, 9 Oct 2019 at 19:21, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> c/s c0902a9a143a refactored hvm_enable() a little, but dropped the logic which
> cleared hap_supported in the case that the user had asked for it off.
>
> This results in Xen booting up, claiming:
>
>   (XEN) HVM: Hardware Assisted Paging (HAP) detected but disabled
>
> but with HAP advertised via sysctl, and XEN_DOMCTL_CDF_hap being accepted in
> domain_create().
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Wei Liu <wl@xen.org>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [PATCH] x86/hvm: Fix the use of "hap=0" following c/s c0902a9a143a
  2019-10-09 18:21 [Xen-devel] [PATCH] x86/hvm: Fix the use of "hap=0" following c/s c0902a9a143a Andrew Cooper
  2019-10-09 18:56 ` Paul Durrant
  2019-10-09 19:05 ` Wei Liu
@ 2019-10-10  4:19 ` Jürgen Groß
  2 siblings, 0 replies; 5+ messages in thread
From: Jürgen Groß @ 2019-10-10  4:19 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel
  Cc: Paul Durrant, Wei Liu, Jan Beulich, Roger Pau Monné

On 09.10.19 20:21, Andrew Cooper wrote:
> c/s c0902a9a143a refactored hvm_enable() a little, but dropped the logic which
> cleared hap_supported in the case that the user had asked for it off.
> 
> This results in Xen booting up, claiming:
> 
>    (XEN) HVM: Hardware Assisted Paging (HAP) detected but disabled
> 
> but with HAP advertised via sysctl, and XEN_DOMCTL_CDF_hap being accepted in
> domain_create().
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Release-acked-by: Juergen Gross <jgross@suse.com>


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xen-devel] [PATCH] x86/hvm: Fix the use of "hap=0" following c/s c0902a9a143a
  2019-10-09 18:56 ` Paul Durrant
@ 2019-10-10  7:06   ` Jan Beulich
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Beulich @ 2019-10-10  7:06 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Juergen Gross, Wei Liu, Paul Durrant, Paul Durrant, Xen-devel,
	Roger Pau Monné

On 09.10.2019 20:56, Paul Durrant wrote:
> On Wed, 9 Oct 2019 at 19:21, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>
>> c/s c0902a9a143a refactored hvm_enable() a little, but dropped the logic which
>> cleared hap_supported in the case that the user had asked for it off.
>>
>> This results in Xen booting up, claiming:
>>
>>   (XEN) HVM: Hardware Assisted Paging (HAP) detected but disabled
>>
>> but with HAP advertised via sysctl, and XEN_DOMCTL_CDF_hap being accepted in
>> domain_create().
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> That should have been largely code movement, so I don't know how I
> managed to drop that.
> 
> Reviewed-by: Paul Durrant <paul@xen.org>

Acked-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-09 18:21 [Xen-devel] [PATCH] x86/hvm: Fix the use of "hap=0" following c/s c0902a9a143a Andrew Cooper
2019-10-09 18:56 ` Paul Durrant
2019-10-10  7:06   ` Jan Beulich
2019-10-09 19:05 ` Wei Liu
2019-10-10  4:19 ` Jürgen Groß

Xen-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/xen-devel/0 xen-devel/git/0.git
	git clone --mirror https://lore.kernel.org/xen-devel/1 xen-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 xen-devel xen-devel/ https://lore.kernel.org/xen-devel \
		xen-devel@lists.xenproject.org xen-devel@lists.xen.org xen-devel@archiver.kernel.org
	public-inbox-index xen-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.xenproject.lists.xen-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox