All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools/libxl: Don't read STORE/CONSOLE_PFN from Xen
@ 2021-12-09 17:07 Andrew Cooper
  2021-12-10 11:16 ` Juergen Gross
  2021-12-14 18:11 ` Anthony PERARD
  0 siblings, 2 replies; 6+ messages in thread
From: Andrew Cooper @ 2021-12-09 17:07 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Wei Liu, Anthony PERARD, Juergen Gross

The values are already available in dom->{console,xenstore}_pfn, just like on
the PV side of things.  No need to ask Xen.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Wei Liu <wl@xen.org>
CC: Anthony PERARD <anthony.perard@citrix.com>
CC: Juergen Gross <jgross@suse.com>
---
 tools/libs/light/libxl_dom.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
index c9c24666cd04..03841243ab47 100644
--- a/tools/libs/light/libxl_dom.c
+++ b/tools/libs/light/libxl_dom.c
@@ -722,13 +722,10 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
 }
 
 static int hvm_build_set_params(xc_interface *handle, uint32_t domid,
-                                libxl_domain_build_info *info,
-                                unsigned long *store_mfn,
-                                unsigned long *console_mfn)
+                                libxl_domain_build_info *info)
 {
     struct hvm_info_table *va_hvm;
     uint8_t *va_map, sum;
-    uint64_t str_mfn, cons_mfn;
     int i;
 
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
@@ -749,12 +746,6 @@ static int hvm_build_set_params(xc_interface *handle, uint32_t domid,
         munmap(va_map, XC_PAGE_SIZE);
     }
 
-    xc_hvm_param_get(handle, domid, HVM_PARAM_STORE_PFN, &str_mfn);
-    xc_hvm_param_get(handle, domid, HVM_PARAM_CONSOLE_PFN, &cons_mfn);
-
-    *store_mfn = str_mfn;
-    *console_mfn = cons_mfn;
-
     return 0;
 }
 
@@ -1168,12 +1159,14 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
     if (rc != 0)
         goto out;
 
-    rc = hvm_build_set_params(ctx->xch, domid, info, &state->store_mfn,
-                              &state->console_mfn);
+    rc = hvm_build_set_params(ctx->xch, domid, info);
     if (rc != 0) {
         LOG(ERROR, "hvm build set params failed");
         goto out;
     }
+
+    state->console_mfn = dom->console_pfn;
+    state->store_mfn = dom->xenstore_pfn;
     state->vuart_gfn = dom->vuart_gfn;
 
     rc = hvm_build_set_xs_values(gc, domid, dom, info);
-- 
2.11.0



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

* Re: [PATCH] tools/libxl: Don't read STORE/CONSOLE_PFN from Xen
  2021-12-09 17:07 [PATCH] tools/libxl: Don't read STORE/CONSOLE_PFN from Xen Andrew Cooper
@ 2021-12-10 11:16 ` Juergen Gross
  2021-12-10 13:49   ` Andrew Cooper
  2021-12-14 18:11 ` Anthony PERARD
  1 sibling, 1 reply; 6+ messages in thread
From: Juergen Gross @ 2021-12-10 11:16 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel; +Cc: Wei Liu, Anthony PERARD


[-- Attachment #1.1.1: Type: text/plain, Size: 1430 bytes --]

On 09.12.21 18:07, Andrew Cooper wrote:
> The values are already available in dom->{console,xenstore}_pfn, just like on
> the PV side of things.  No need to ask Xen.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Wei Liu <wl@xen.org>
> CC: Anthony PERARD <anthony.perard@citrix.com>
> CC: Juergen Gross <jgross@suse.com>
> ---
>   tools/libs/light/libxl_dom.c | 17 +++++------------
>   1 file changed, 5 insertions(+), 12 deletions(-)
> 
> diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
> index c9c24666cd04..03841243ab47 100644
> --- a/tools/libs/light/libxl_dom.c
> +++ b/tools/libs/light/libxl_dom.c
> @@ -722,13 +722,10 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
>   }
>   
>   static int hvm_build_set_params(xc_interface *handle, uint32_t domid,
> -                                libxl_domain_build_info *info,
> -                                unsigned long *store_mfn,
> -                                unsigned long *console_mfn)
> +                                libxl_domain_build_info *info)
>   {
>       struct hvm_info_table *va_hvm;
>       uint8_t *va_map, sum;
> -    uint64_t str_mfn, cons_mfn;
>       int i;
>   
>       if (info->type == LIBXL_DOMAIN_TYPE_HVM) {

What about moving this if () to the only caller and renaming the
function from hvm_build_set_params() to hvm_set_info_table()?


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH] tools/libxl: Don't read STORE/CONSOLE_PFN from Xen
  2021-12-10 11:16 ` Juergen Gross
@ 2021-12-10 13:49   ` Andrew Cooper
  2021-12-10 14:08     ` Juergen Gross
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Cooper @ 2021-12-10 13:49 UTC (permalink / raw)
  To: Juergen Gross, Andrew Cooper, Xen-devel; +Cc: Wei Liu, Anthony PERARD

On 10/12/2021 11:16, Juergen Gross wrote:
> On 09.12.21 18:07, Andrew Cooper wrote:
>> The values are already available in dom->{console,xenstore}_pfn, just
>> like on
>> the PV side of things.  No need to ask Xen.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Wei Liu <wl@xen.org>
>> CC: Anthony PERARD <anthony.perard@citrix.com>
>> CC: Juergen Gross <jgross@suse.com>
>> ---
>>   tools/libs/light/libxl_dom.c | 17 +++++------------
>>   1 file changed, 5 insertions(+), 12 deletions(-)
>>
>> diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
>> index c9c24666cd04..03841243ab47 100644
>> --- a/tools/libs/light/libxl_dom.c
>> +++ b/tools/libs/light/libxl_dom.c
>> @@ -722,13 +722,10 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
>>   }
>>     static int hvm_build_set_params(xc_interface *handle, uint32_t
>> domid,
>> -                                libxl_domain_build_info *info,
>> -                                unsigned long *store_mfn,
>> -                                unsigned long *console_mfn)
>> +                                libxl_domain_build_info *info)
>>   {
>>       struct hvm_info_table *va_hvm;
>>       uint8_t *va_map, sum;
>> -    uint64_t str_mfn, cons_mfn;
>>       int i;
>>         if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
>
> What about moving this if () to the only caller and renaming the
> function from hvm_build_set_params() to hvm_set_info_table()?

Because I was hoping to delete it outright in a subsequent patch.

~Andrew


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

* Re: [PATCH] tools/libxl: Don't read STORE/CONSOLE_PFN from Xen
  2021-12-10 13:49   ` Andrew Cooper
@ 2021-12-10 14:08     ` Juergen Gross
  2021-12-13 17:22       ` Andrew Cooper
  0 siblings, 1 reply; 6+ messages in thread
From: Juergen Gross @ 2021-12-10 14:08 UTC (permalink / raw)
  To: Andrew Cooper, Andrew Cooper, Xen-devel; +Cc: Wei Liu, Anthony PERARD


[-- Attachment #1.1.1: Type: text/plain, Size: 1924 bytes --]

On 10.12.21 14:49, Andrew Cooper wrote:
> On 10/12/2021 11:16, Juergen Gross wrote:
>> On 09.12.21 18:07, Andrew Cooper wrote:
>>> The values are already available in dom->{console,xenstore}_pfn, just
>>> like on
>>> the PV side of things.  No need to ask Xen.
>>>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> ---
>>> CC: Wei Liu <wl@xen.org>
>>> CC: Anthony PERARD <anthony.perard@citrix.com>
>>> CC: Juergen Gross <jgross@suse.com>
>>> ---
>>>    tools/libs/light/libxl_dom.c | 17 +++++------------
>>>    1 file changed, 5 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c
>>> index c9c24666cd04..03841243ab47 100644
>>> --- a/tools/libs/light/libxl_dom.c
>>> +++ b/tools/libs/light/libxl_dom.c
>>> @@ -722,13 +722,10 @@ int libxl__build_pv(libxl__gc *gc, uint32_t domid,
>>>    }
>>>      static int hvm_build_set_params(xc_interface *handle, uint32_t
>>> domid,
>>> -                                libxl_domain_build_info *info,
>>> -                                unsigned long *store_mfn,
>>> -                                unsigned long *console_mfn)
>>> +                                libxl_domain_build_info *info)
>>>    {
>>>        struct hvm_info_table *va_hvm;
>>>        uint8_t *va_map, sum;
>>> -    uint64_t str_mfn, cons_mfn;
>>>        int i;
>>>          if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
>>
>> What about moving this if () to the only caller and renaming the
>> function from hvm_build_set_params() to hvm_set_info_table()?
> 
> Because I was hoping to delete it outright in a subsequent patch.

I'd suggest to either do the renaming or to add that subsequent patch
making this a small series.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH] tools/libxl: Don't read STORE/CONSOLE_PFN from Xen
  2021-12-10 14:08     ` Juergen Gross
@ 2021-12-13 17:22       ` Andrew Cooper
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Cooper @ 2021-12-13 17:22 UTC (permalink / raw)
  To: Juergen Gross, Andrew Cooper, Xen-devel; +Cc: Wei Liu, Anthony PERARD

On 10/12/2021 14:08, Juergen Gross wrote:
> On 10.12.21 14:49, Andrew Cooper wrote:
>> On 10/12/2021 11:16, Juergen Gross wrote:
>>> On 09.12.21 18:07, Andrew Cooper wrote:
>>>> The values are already available in dom->{console,xenstore}_pfn, just
>>>> like on
>>>> the PV side of things.  No need to ask Xen.
>>>>
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>>> ---
>>>> CC: Wei Liu <wl@xen.org>
>>>> CC: Anthony PERARD <anthony.perard@citrix.com>
>>>> CC: Juergen Gross <jgross@suse.com>
>>>> ---
>>>>    tools/libs/light/libxl_dom.c | 17 +++++------------
>>>>    1 file changed, 5 insertions(+), 12 deletions(-)
>>>>
>>>> diff --git a/tools/libs/light/libxl_dom.c
>>>> b/tools/libs/light/libxl_dom.c
>>>> index c9c24666cd04..03841243ab47 100644
>>>> --- a/tools/libs/light/libxl_dom.c
>>>> +++ b/tools/libs/light/libxl_dom.c
>>>> @@ -722,13 +722,10 @@ int libxl__build_pv(libxl__gc *gc, uint32_t
>>>> domid,
>>>>    }
>>>>      static int hvm_build_set_params(xc_interface *handle, uint32_t
>>>> domid,
>>>> -                                libxl_domain_build_info *info,
>>>> -                                unsigned long *store_mfn,
>>>> -                                unsigned long *console_mfn)
>>>> +                                libxl_domain_build_info *info)
>>>>    {
>>>>        struct hvm_info_table *va_hvm;
>>>>        uint8_t *va_map, sum;
>>>> -    uint64_t str_mfn, cons_mfn;
>>>>        int i;
>>>>          if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
>>>
>>> What about moving this if () to the only caller and renaming the
>>> function from hvm_build_set_params() to hvm_set_info_table()?
>>
>> Because I was hoping to delete it outright in a subsequent patch.
>
> I'd suggest to either do the renaming or to add that subsequent patch
> making this a small series.

That's a separate task, which I don't have time to untangle right now.

I don't think it is worth delaying this improvement for a future
only-tangentially-related change.

~Andrew


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

* Re: [PATCH] tools/libxl: Don't read STORE/CONSOLE_PFN from Xen
  2021-12-09 17:07 [PATCH] tools/libxl: Don't read STORE/CONSOLE_PFN from Xen Andrew Cooper
  2021-12-10 11:16 ` Juergen Gross
@ 2021-12-14 18:11 ` Anthony PERARD
  1 sibling, 0 replies; 6+ messages in thread
From: Anthony PERARD @ 2021-12-14 18:11 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Xen-devel, Wei Liu, Juergen Gross

On Thu, Dec 09, 2021 at 05:07:52PM +0000, Andrew Cooper wrote:
> The values are already available in dom->{console,xenstore}_pfn, just like on
> the PV side of things.  No need to ask Xen.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,

-- 
Anthony PERARD


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

end of thread, other threads:[~2021-12-14 18:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 17:07 [PATCH] tools/libxl: Don't read STORE/CONSOLE_PFN from Xen Andrew Cooper
2021-12-10 11:16 ` Juergen Gross
2021-12-10 13:49   ` Andrew Cooper
2021-12-10 14:08     ` Juergen Gross
2021-12-13 17:22       ` Andrew Cooper
2021-12-14 18:11 ` Anthony PERARD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.