Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-22 Thread Jan Beulich
On 22.04.2021 14:07, Roger Pau Monné wrote: > On Thu, Apr 22, 2021 at 01:42:45PM +0200, Jan Beulich wrote: >> On 22.04.2021 13:37, Roger Pau Monné wrote: >>> On Thu, Apr 22, 2021 at 01:05:23PM +0200, Jan Beulich wrote: On 22.04.2021 12:56, Roger Pau Monné wrote: > On Thu, Apr 22, 2021 at 1

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-22 Thread Roger Pau Monné
On Thu, Apr 22, 2021 at 01:42:45PM +0200, Jan Beulich wrote: > On 22.04.2021 13:37, Roger Pau Monné wrote: > > On Thu, Apr 22, 2021 at 01:05:23PM +0200, Jan Beulich wrote: > >> On 22.04.2021 12:56, Roger Pau Monné wrote: > >>> On Thu, Apr 22, 2021 at 12:48:36PM +0200, Jan Beulich wrote: > On 2

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-22 Thread Jan Beulich
On 22.04.2021 13:37, Roger Pau Monné wrote: > On Thu, Apr 22, 2021 at 01:05:23PM +0200, Jan Beulich wrote: >> On 22.04.2021 12:56, Roger Pau Monné wrote: >>> On Thu, Apr 22, 2021 at 12:48:36PM +0200, Jan Beulich wrote: On 22.04.2021 12:34, Roger Pau Monné wrote: > On Thu, Apr 22, 2021 at 1

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-22 Thread Roger Pau Monné
On Thu, Apr 22, 2021 at 01:05:23PM +0200, Jan Beulich wrote: > On 22.04.2021 12:56, Roger Pau Monné wrote: > > On Thu, Apr 22, 2021 at 12:48:36PM +0200, Jan Beulich wrote: > >> On 22.04.2021 12:34, Roger Pau Monné wrote: > >>> On Thu, Apr 22, 2021 at 11:58:45AM +0200, Jan Beulich wrote: > On 2

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-22 Thread Jan Beulich
On 22.04.2021 12:56, Roger Pau Monné wrote: > On Thu, Apr 22, 2021 at 12:48:36PM +0200, Jan Beulich wrote: >> On 22.04.2021 12:34, Roger Pau Monné wrote: >>> On Thu, Apr 22, 2021 at 11:58:45AM +0200, Jan Beulich wrote: On 22.04.2021 11:42, Roger Pau Monné wrote: > On Wed, Apr 14, 2021 at 0

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-22 Thread Roger Pau Monné
On Thu, Apr 22, 2021 at 12:48:36PM +0200, Jan Beulich wrote: > On 22.04.2021 12:34, Roger Pau Monné wrote: > > On Thu, Apr 22, 2021 at 11:58:45AM +0200, Jan Beulich wrote: > >> On 22.04.2021 11:42, Roger Pau Monné wrote: > >>> On Wed, Apr 14, 2021 at 03:49:02PM +0200, Jan Beulich wrote: > On 1

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-22 Thread Jan Beulich
On 22.04.2021 12:34, Roger Pau Monné wrote: > On Thu, Apr 22, 2021 at 11:58:45AM +0200, Jan Beulich wrote: >> On 22.04.2021 11:42, Roger Pau Monné wrote: >>> On Wed, Apr 14, 2021 at 03:49:02PM +0200, Jan Beulich wrote: On 13.04.2021 16:01, Roger Pau Monne wrote: > @@ -944,3 +945,130 @@ boo

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-22 Thread Roger Pau Monné
On Thu, Apr 22, 2021 at 11:58:45AM +0200, Jan Beulich wrote: > On 22.04.2021 11:42, Roger Pau Monné wrote: > > On Wed, Apr 14, 2021 at 03:49:02PM +0200, Jan Beulich wrote: > >> On 13.04.2021 16:01, Roger Pau Monne wrote: > >>> @@ -944,3 +945,130 @@ bool xc_cpu_policy_is_compatible(xc_interface *xch

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-22 Thread Jan Beulich
On 22.04.2021 11:42, Roger Pau Monné wrote: > On Wed, Apr 14, 2021 at 03:49:02PM +0200, Jan Beulich wrote: >> On 13.04.2021 16:01, Roger Pau Monne wrote: >>> @@ -944,3 +945,130 @@ bool xc_cpu_policy_is_compatible(xc_interface *xch, >>> const xc_cpu_policy_t host, >>> >>> return false; >>>

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-22 Thread Roger Pau Monné
On Wed, Apr 14, 2021 at 03:49:02PM +0200, Jan Beulich wrote: > On 13.04.2021 16:01, Roger Pau Monne wrote: > > @@ -944,3 +945,130 @@ bool xc_cpu_policy_is_compatible(xc_interface *xch, > > const xc_cpu_policy_t host, > > > > return false; > > } > > + > > +static uint64_t level_msr(unsigned

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-21 Thread Wei Liu
On Wed, Apr 21, 2021 at 01:26:49PM +0200, Roger Pau Monné wrote: > On Wed, Apr 21, 2021 at 10:22:39AM +, Wei Liu wrote: > > On Tue, Apr 13, 2021 at 04:01:33PM +0200, Roger Pau Monne wrote: > > > Introduce a helper to obtain a compatible cpu policy based on two > > > input cpu policies. Currentl

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-21 Thread Roger Pau Monné
On Wed, Apr 21, 2021 at 10:22:39AM +, Wei Liu wrote: > On Tue, Apr 13, 2021 at 04:01:33PM +0200, Roger Pau Monne wrote: > > Introduce a helper to obtain a compatible cpu policy based on two > > input cpu policies. Currently this is done by and'ing all CPUID leaves > > and MSR entries, except fo

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-21 Thread Wei Liu
On Tue, Apr 13, 2021 at 04:01:33PM +0200, Roger Pau Monne wrote: > Introduce a helper to obtain a compatible cpu policy based on two > input cpu policies. Currently this is done by and'ing all CPUID leaves > and MSR entries, except for MSR_ARCH_CAPABILITIES which has the RSBA > bit or'ed. > I tho

Re: [PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-14 Thread Jan Beulich
On 13.04.2021 16:01, Roger Pau Monne wrote: > @@ -944,3 +945,130 @@ bool xc_cpu_policy_is_compatible(xc_interface *xch, > const xc_cpu_policy_t host, > > return false; > } > + > +static uint64_t level_msr(unsigned int index, uint64_t val1, uint64_t val2) > +{ > +uint64_t val = val1 & v

[PATCH v2 15/21] libs/guest: obtain a compatible cpu policy from two input ones

2021-04-13 Thread Roger Pau Monne
Introduce a helper to obtain a compatible cpu policy based on two input cpu policies. Currently this is done by and'ing all CPUID leaves and MSR entries, except for MSR_ARCH_CAPABILITIES which has the RSBA bit or'ed. The _AC macro is pulled from libxl_internal.h into xen-tools/libs.h since it's re