[Xen-devel] [PATCH RFC] x86/shim: Refresh pvshim_defconfig

Andrew Cooper posted 1 patch 4 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20190726101057.21324-1-andrew.cooper3@citrix.com
There is a newer version of this series
tools/firmware/xen-dir/Makefile       | 2 +-
xen/arch/x86/configs/pvshim_defconfig | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
[Xen-devel] [PATCH RFC] x86/shim: Refresh pvshim_defconfig
Posted by Andrew Cooper 4 years, 9 months ago
* Add a dependency so the shim gets rebuilt when pvshim_defconfig changes.
* Default to the NULL scheduler now that it works with vcpu online/offline.

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: Juergen Gross <jgross@suse.com>
CC: Dario Faggioli <dfaggioli@suse.com>

This patch depends on Dario's series, and cant go in until then.

Also RFC.

CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Tamas K Lengyel <tamas@tklengyel.com>

I tried turning off MEM_ACCESS, but I can't get Kconfig to actually turn it
off in the build.  What is the deal with MEM_ACCESS_ALWAYS_ON ?  It makes it
impossible to turn MEM_ACCESS off, becaue it is selected by x86, which leaves
MEM_ACCESS enabled and unmodifiable.
---
 tools/firmware/xen-dir/Makefile       | 2 +-
 xen/arch/x86/configs/pvshim_defconfig | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile
index 83597f0017..7435421251 100644
--- a/tools/firmware/xen-dir/Makefile
+++ b/tools/firmware/xen-dir/Makefile
@@ -41,7 +41,7 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE
 $(D): linkfarm.stamp
 	$(MAKE) -C $(D)/xen distclean
 
-$(D)/xen/.config: $(D)
+$(D)/xen/.config: $(D) $(D)/xen/arch/x86/configs/pvshim_defconfig
 	$(MAKE) -C $(@D) KBUILD_DEFCONFIG=pvshim_defconfig XEN_CONFIG_EXPERT=y defconfig
 
 xen-shim: $(D)/xen/.config
diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/pvshim_defconfig
index 9710aa6238..329aaf9029 100644
--- a/xen/arch/x86/configs/pvshim_defconfig
+++ b/xen/arch/x86/configs/pvshim_defconfig
@@ -5,6 +5,7 @@ CONFIG_PVH_GUEST=y
 CONFIG_PV_SHIM=y
 CONFIG_PV_SHIM_EXCLUSIVE=y
 CONFIG_NR_CPUS=32
+CONFIG_SCHED_NULL=y
 # Disable features not used by the PV shim
 # CONFIG_SHADOW_PAGING is not set
 # CONFIG_BIGMEM is not set
@@ -13,10 +14,12 @@ CONFIG_NR_CPUS=32
 # CONFIG_KEXEC is not set
 # CONFIG_XENOPROF is not set
 # CONFIG_XSM is not set
+# CONFIG_SCHED_CREDIT is not set
 # CONFIG_SCHED_CREDIT2 is not set
 # CONFIG_SCHED_RTDS is not set
 # CONFIG_SCHED_ARINC653 is not set
-# CONFIG_SCHED_NULL is not set
 # CONFIG_LIVEPATCH is not set
 # CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS is not set
 # CONFIG_DEBUG is not set
+# CONFIG_MEM_ACCESS_ALWAYS_ON is not set
+# CONFIG_MEM_ACCESS is not set
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH RFC] x86/shim: Refresh pvshim_defconfig
Posted by Juergen Gross 4 years, 9 months ago
On 26.07.19 12:10, Andrew Cooper wrote:
> * Add a dependency so the shim gets rebuilt when pvshim_defconfig changes.
> * Default to the NULL scheduler now that it works with vcpu online/offline.
> 
> 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: Juergen Gross <jgross@suse.com>
> CC: Dario Faggioli <dfaggioli@suse.com>
> 
> This patch depends on Dario's series, and cant go in until then.
> 
> Also RFC.
> 
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Tamas K Lengyel <tamas@tklengyel.com>
> 
> I tried turning off MEM_ACCESS, but I can't get Kconfig to actually turn it
> off in the build.  What is the deal with MEM_ACCESS_ALWAYS_ON ?  It makes it
> impossible to turn MEM_ACCESS off, becaue it is selected by x86, which leaves
> MEM_ACCESS enabled and unmodifiable.

modify arch/x86/Kconfig like:

-	select MEM_ACCESS_ALWAYS_ON
+	select MEM_ACCESS_ALWAYS_ON if !PV_SHIM_EXCLUSIVE

???

Juergen

> ---
>   tools/firmware/xen-dir/Makefile       | 2 +-
>   xen/arch/x86/configs/pvshim_defconfig | 5 ++++-
>   2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/firmware/xen-dir/Makefile b/tools/firmware/xen-dir/Makefile
> index 83597f0017..7435421251 100644
> --- a/tools/firmware/xen-dir/Makefile
> +++ b/tools/firmware/xen-dir/Makefile
> @@ -41,7 +41,7 @@ linkfarm.stamp: $(DEP_DIRS) $(DEP_FILES) FORCE
>   $(D): linkfarm.stamp
>   	$(MAKE) -C $(D)/xen distclean
>   
> -$(D)/xen/.config: $(D)
> +$(D)/xen/.config: $(D) $(D)/xen/arch/x86/configs/pvshim_defconfig
>   	$(MAKE) -C $(@D) KBUILD_DEFCONFIG=pvshim_defconfig XEN_CONFIG_EXPERT=y defconfig
>   
>   xen-shim: $(D)/xen/.config
> diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/pvshim_defconfig
> index 9710aa6238..329aaf9029 100644
> --- a/xen/arch/x86/configs/pvshim_defconfig
> +++ b/xen/arch/x86/configs/pvshim_defconfig
> @@ -5,6 +5,7 @@ CONFIG_PVH_GUEST=y
>   CONFIG_PV_SHIM=y
>   CONFIG_PV_SHIM_EXCLUSIVE=y
>   CONFIG_NR_CPUS=32
> +CONFIG_SCHED_NULL=y
>   # Disable features not used by the PV shim
>   # CONFIG_SHADOW_PAGING is not set
>   # CONFIG_BIGMEM is not set
> @@ -13,10 +14,12 @@ CONFIG_NR_CPUS=32
>   # CONFIG_KEXEC is not set
>   # CONFIG_XENOPROF is not set
>   # CONFIG_XSM is not set
> +# CONFIG_SCHED_CREDIT is not set
>   # CONFIG_SCHED_CREDIT2 is not set
>   # CONFIG_SCHED_RTDS is not set
>   # CONFIG_SCHED_ARINC653 is not set
> -# CONFIG_SCHED_NULL is not set
>   # CONFIG_LIVEPATCH is not set
>   # CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS is not set
>   # CONFIG_DEBUG is not set
> +# CONFIG_MEM_ACCESS_ALWAYS_ON is not set
> +# CONFIG_MEM_ACCESS is not set
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH RFC] x86/shim: Refresh pvshim_defconfig
Posted by Tamas K Lengyel 4 years, 9 months ago
On Fri, Jul 26, 2019 at 4:11 AM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> * Add a dependency so the shim gets rebuilt when pvshim_defconfig changes.
> * Default to the NULL scheduler now that it works with vcpu online/offline.
>
> 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: Juergen Gross <jgross@suse.com>
> CC: Dario Faggioli <dfaggioli@suse.com>
>
> This patch depends on Dario's series, and cant go in until then.
>
> Also RFC.
>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Tamas K Lengyel <tamas@tklengyel.com>
>
> I tried turning off MEM_ACCESS, but I can't get Kconfig to actually turn it
> off in the build.  What is the deal with MEM_ACCESS_ALWAYS_ON ?  It makes it
> impossible to turn MEM_ACCESS off, becaue it is selected by x86, which leaves
> MEM_ACCESS enabled and unmodifiable.

We never made it configurable to have MEM_ACCESS be disabled on x86.
The option only exists because when I started moving vm_event to
common code it had to be disabled for ARM at first. Then it looks like
Stefano did make it configurable for ARM so there it can actually be
disabled.

Tamas

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH RFC] x86/shim: Refresh pvshim_defconfig
Posted by Andrew Cooper 4 years, 9 months ago
On 26/07/2019 13:55, Tamas K Lengyel wrote:
> On Fri, Jul 26, 2019 at 4:11 AM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> * Add a dependency so the shim gets rebuilt when pvshim_defconfig changes.
>> * Default to the NULL scheduler now that it works with vcpu online/offline.
>>
>> 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: Juergen Gross <jgross@suse.com>
>> CC: Dario Faggioli <dfaggioli@suse.com>
>>
>> This patch depends on Dario's series, and cant go in until then.
>>
>> Also RFC.
>>
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>> CC: Tamas K Lengyel <tamas@tklengyel.com>
>>
>> I tried turning off MEM_ACCESS, but I can't get Kconfig to actually turn it
>> off in the build.  What is the deal with MEM_ACCESS_ALWAYS_ON ?  It makes it
>> impossible to turn MEM_ACCESS off, becaue it is selected by x86, which leaves
>> MEM_ACCESS enabled and unmodifiable.
> We never made it configurable to have MEM_ACCESS be disabled on x86.
> The option only exists because when I started moving vm_event to
> common code it had to be disabled for ARM at first. Then it looks like
> Stefano did make it configurable for ARM so there it can actually be
> disabled.

Is it something we could consider making configurable at this point? 
Its certainly something we'd want to turn off in the PV shim build.

While thinking about it, it is specific to HVM guests, so ought to
depend on CONFIG_HVM anyway, which might be the easiest way to exclude
it for the PV shim build if we don't want to make it actively
configurable yet.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH RFC] x86/shim: Refresh pvshim_defconfig
Posted by Tamas K Lengyel 4 years, 9 months ago
On Fri, Jul 26, 2019 at 6:58 AM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> On 26/07/2019 13:55, Tamas K Lengyel wrote:
> > On Fri, Jul 26, 2019 at 4:11 AM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
> >> * Add a dependency so the shim gets rebuilt when pvshim_defconfig changes.
> >> * Default to the NULL scheduler now that it works with vcpu online/offline.
> >>
> >> 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: Juergen Gross <jgross@suse.com>
> >> CC: Dario Faggioli <dfaggioli@suse.com>
> >>
> >> This patch depends on Dario's series, and cant go in until then.
> >>
> >> Also RFC.
> >>
> >> CC: Stefano Stabellini <sstabellini@kernel.org>
> >> CC: Tamas K Lengyel <tamas@tklengyel.com>
> >>
> >> I tried turning off MEM_ACCESS, but I can't get Kconfig to actually turn it
> >> off in the build.  What is the deal with MEM_ACCESS_ALWAYS_ON ?  It makes it
> >> impossible to turn MEM_ACCESS off, becaue it is selected by x86, which leaves
> >> MEM_ACCESS enabled and unmodifiable.
> > We never made it configurable to have MEM_ACCESS be disabled on x86.
> > The option only exists because when I started moving vm_event to
> > common code it had to be disabled for ARM at first. Then it looks like
> > Stefano did make it configurable for ARM so there it can actually be
> > disabled.
>
> Is it something we could consider making configurable at this point?
> Its certainly something we'd want to turn off in the PV shim build.
>
> While thinking about it, it is specific to HVM guests, so ought to
> depend on CONFIG_HVM anyway, which might be the easiest way to exclude
> it for the PV shim build if we don't want to make it actively
> configurable yet.

Sure, I would Ack a patch that makes it configurable. There were some
works in the past to make mem_access for PV domains as well but that
was a while ago, I don't think anyone has interest in that anymore.
Making it depend on HVM for x86 builds sounds reasonable to me, not
sure if that would work for ARM though as I don't think it has HVM
config option. Anyway, if someone makes changes to this I would highly
prefer to get rid of the MEM_ACCESS_ALWAYS_ON config option as it's a
confusing option name.

Tamas

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH RFC] x86/shim: Refresh pvshim_defconfig
Posted by Andrew Cooper 4 years, 9 months ago
On 26/07/2019 14:10, Tamas K Lengyel wrote:
> On Fri, Jul 26, 2019 at 6:58 AM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> On 26/07/2019 13:55, Tamas K Lengyel wrote:
>>> On Fri, Jul 26, 2019 at 4:11 AM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>>>> * Add a dependency so the shim gets rebuilt when pvshim_defconfig changes.
>>>> * Default to the NULL scheduler now that it works with vcpu online/offline.
>>>>
>>>> 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: Juergen Gross <jgross@suse.com>
>>>> CC: Dario Faggioli <dfaggioli@suse.com>
>>>>
>>>> This patch depends on Dario's series, and cant go in until then.
>>>>
>>>> Also RFC.
>>>>
>>>> CC: Stefano Stabellini <sstabellini@kernel.org>
>>>> CC: Tamas K Lengyel <tamas@tklengyel.com>
>>>>
>>>> I tried turning off MEM_ACCESS, but I can't get Kconfig to actually turn it
>>>> off in the build.  What is the deal with MEM_ACCESS_ALWAYS_ON ?  It makes it
>>>> impossible to turn MEM_ACCESS off, becaue it is selected by x86, which leaves
>>>> MEM_ACCESS enabled and unmodifiable.
>>> We never made it configurable to have MEM_ACCESS be disabled on x86.
>>> The option only exists because when I started moving vm_event to
>>> common code it had to be disabled for ARM at first. Then it looks like
>>> Stefano did make it configurable for ARM so there it can actually be
>>> disabled.
>> Is it something we could consider making configurable at this point?
>> Its certainly something we'd want to turn off in the PV shim build.
>>
>> While thinking about it, it is specific to HVM guests, so ought to
>> depend on CONFIG_HVM anyway, which might be the easiest way to exclude
>> it for the PV shim build if we don't want to make it actively
>> configurable yet.
> Sure, I would Ack a patch that makes it configurable. There were some
> works in the past to make mem_access for PV domains as well but that
> was a while ago, I don't think anyone has interest in that anymore.

The access ring is obtained via an HVM_PARAM.  There is no conceivable
way it works for PV.

This is one of the reasons for the different design of "NG" interface
which Petre is doing, so functionality like this could (in principle) be
made compatible with PV in the future.

> Making it depend on HVM for x86 builds sounds reasonable to me, not
> sure if that would work for ARM though as I don't think it has HVM
> config option. Anyway, if someone makes changes to this I would highly
> prefer to get rid of the MEM_ACCESS_ALWAYS_ON config option as it's a
> confusing option name.

Ok - I'll see about finding some copious free time.

~Andrew

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