HVM domU not created anymore in staging

2023-05-30 Thread Olaf Hering
For some reason the staging branch fails to create HVM domUs for me. It seems there was some breakage introduced between 20230522T161155.c7908869 and 20230526T091957.40cd186b. I was hoping that osstest will spot this failure and do the bisect for me, but apparently there is no report yet. Did osste

xentrace buffer size, maxcpus and online cpus

2023-05-30 Thread Olaf Hering
While looking again through calculate_tbuf_size after a very long time, I was wondering why the code uses nr_cpu_ids instead of num_online_cpus. In case Xen was booted with maxcpus=N, would it be safe to use N as upper limit? I think this would increase the per-cpu buffer size for each active pcpu,

Re: [PATCH v2 1/2] x86: annotate entry points with type and size

2023-05-30 Thread Jan Beulich
On 29.05.2023 15:34, Roger Pau Monné wrote: > On Tue, May 23, 2023 at 01:30:51PM +0200, Jan Beulich wrote: >> Note that the FB-label in autogen_stubs() cannot be converted just yet: >> Such labels cannot be used with .type. We could further diverge from >> Linux'es model and avoid setting STT_NOTYP

[PATCH v6 00/14] tools/xenstore: rework internal accounting

2023-05-30 Thread Juergen Gross
This series reworks the Xenstore internal accounting to use a uniform generic framework. It is adding some additional useful diagnostic information, like accounting trace and max. per-domain and global quota values seen. Changes in V2: - added patch 1 (leftover from previous series) - rebase Chan

[PATCH v6 01/14] tools/xenstore: take transaction internal nodes into account for quota

2023-05-30 Thread Juergen Gross
The accounting for the number of nodes of a domain in an active transaction is not working correctly, as it is checking the node quota only against the number of nodes outside the transaction. This can result in the transaction finally failing, as node quota is checked at the end of the transactio

[PATCH v6 02/14] tools/xenstore: manage per-transaction domain accounting data in an array

2023-05-30 Thread Juergen Gross
In order to prepare keeping accounting data in an array instead of using independent fields, switch the struct changed_domain accounting data to that scheme, for now only using an array with one element. In order to be able to extend this scheme add the needed indexing enum to xenstored_domain.h.

[PATCH v6 03/14] tools/xenstore: introduce accounting data array for per-domain values

2023-05-30 Thread Juergen Gross
Introduce the scheme of an accounting data array for per-domain accounting data and use it initially for the number of nodes owned by a domain. Make the accounting data type to be unsigned int, as no data is allowed to be negative at any time. Signed-off-by: Juergen Gross Reviewed-by: Julien Gra

[PATCH v6 04/14] tools/xenstore: add framework to commit accounting data on success only

2023-05-30 Thread Juergen Gross
Instead of modifying accounting data and undo those modifications in case of an error during further processing, add a framework for collecting the needed changes and commit them only when the whole operation has succeeded. This scheme can reuse large parts of the per transaction accounting. The c

[PATCH v6 05/14] tools/xenstore: use accounting buffering for node accounting

2023-05-30 Thread Juergen Gross
Add the node accounting to the accounting information buffering in order to avoid having to undo it in case of failure. This requires to call domain_nbentry_dec() before any changes to the data base, as it can return an error now. Signed-off-by: Juergen Gross --- V5: - add error handling after d

[PATCH v6 06/14] tools/xenstore: add current connection to domain_memory_add() parameters

2023-05-30 Thread Juergen Gross
In order to enable switching memory accounting to the generic array based accounting, add the current connection to the parameters of domain_memory_add(). This requires to add the connection to some other functions, too. Signed-off-by: Juergen Gross Acked-by: Julien Grall --- tools/xenstore/xe

[PATCH v6 07/14] tools/xenstore: use accounting data array for per-domain values

2023-05-30 Thread Juergen Gross
Add the accounting of per-domain usage of Xenstore memory, watches, and outstanding requests to the array based mechanism. Signed-off-by: Juergen Gross Acked-by: Julien Grall --- V5: - drop domid parameter from domain_outstanding_inc() (Julien Grall) --- tools/xenstore/xenstored_core.c | 4

[PATCH v6 08/14] tools/xenstore: add accounting trace support

2023-05-30 Thread Juergen Gross
Add a new trace switch "acc" and the related trace calls. The "acc" switch is off per default. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- tools/xenstore/xenstored_core.c | 2 +- tools/xenstore/xenstored_core.h | 1 + tools/xenstore/xenstored_domain.c | 10 ++ 3 fi

[PATCH v6 10/14] tools/xenstore: switch transaction accounting to generic accounting

2023-05-30 Thread Juergen Gross
As transaction accounting is active for unprivileged domains only, it can easily be added to the generic per-domain accounting. Signed-off-by: Juergen Gross Acked-by: Julien Grall --- V5: - use list_empty(&conn->transaction_list) for detection of "no transaction active" (Julien Grall) V6: - mo

[PATCH v6 09/14] tools/xenstore: add TDB access trace support

2023-05-30 Thread Juergen Gross
Add a new trace switch "tdb" and the related trace calls. The "tdb" switch is off per default. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- tools/xenstore/xenstored_core.c| 8 +++- tools/xenstore/xenstored_core.h| 7 +++ tools/xenstore/xenstored_transactio

[PATCH v6 11/14] tools/xenstore: remember global and per domain max accounting values

2023-05-30 Thread Juergen Gross
Add saving the maximum values of the different accounting data seen per domain and (for unprivileged domains) globally, and print those values via the xenstore-control quota command. Add a sub-command for resetting the global maximum values seen. This should help for a decision how to set the rela

[PATCH v6 14/14] tools/xenstore: switch quota management to be table based

2023-05-30 Thread Juergen Gross
Instead of having individual quota variables switch to a table based approach like the generic accounting. Include all the related data in the same table and add accessor functions. This enables to use the command line --quota parameter for setting all possible quota values, keeping the previous p

[PATCH v6 12/14] tools/xenstore: use generic accounting for remaining quotas

2023-05-30 Thread Juergen Gross
The maxrequests, node size, number of node permissions, and path length quota are a little bit special, as they are either active in transactions only (maxrequests), or they are just per item instead of count values. Nevertheless being able to know the maximum number of those quota related values p

Re: [PATCH 2/3] x86: Add support for AMD's Automatic IBRS

2023-05-30 Thread Jan Beulich
On 26.05.2023 17:00, Alejandro Vallejo wrote: > --- a/xen/arch/x86/smpboot.c > +++ b/xen/arch/x86/smpboot.c > @@ -376,6 +376,9 @@ void start_secondary(void *unused) > { > wrmsrl(MSR_SPEC_CTRL, default_xen_spec_ctrl); > info->last_spec_ctrl = default_xen_spec_ctrl; > + > +

[PATCH v6 13/14] tools/xenstore: switch get_optval_int() to get_optval_uint()

2023-05-30 Thread Juergen Gross
Let get_optval_int() return an unsigned value and rename it accordingly. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- V5: - new patch, carved out from next patch in series (Julien Grall) --- tools/xenstore/xenstored_core.c | 12 ++-- 1 file changed, 6 insertions(+), 6 dele

[ovmf test] 181008: tolerable FAIL - PUSHED

2023-05-30 Thread osstest service owner
flight 181008 ovmf real [real] flight 181010 ovmf real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/181008/ http://logs.test-lab.xenproject.org/osstest/logs/181010/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-amd64-xl-qemuu

Re: xentrace buffer size, maxcpus and online cpus

2023-05-30 Thread Jan Beulich
On 30.05.2023 09:58, Olaf Hering wrote: > While looking again through calculate_tbuf_size after a very long time, > I was wondering why the code uses nr_cpu_ids instead of num_online_cpus. > In case Xen was booted with maxcpus=N, would it be safe to use N as > upper limit? I think this would increa

Re: [PATCH RFC v2] vPCI: account for hidden devices

2023-05-30 Thread Jan Beulich
On 29.05.2023 10:08, Roger Pau Monné wrote: > On Thu, May 25, 2023 at 05:30:54PM +0200, Jan Beulich wrote: >> On 25.05.2023 17:02, Roger Pau Monné wrote: >>> On Thu, May 25, 2023 at 04:39:51PM +0200, Jan Beulich wrote: On 24.05.2023 17:56, Roger Pau Monné wrote: > On Wed, May 24, 2023 at 0

Re: [PATCH] x86/vPIC: register only one ELCR handler instance

2023-05-30 Thread Jan Beulich
On 29.05.2023 10:39, Roger Pau Monné wrote: > On Fri, May 26, 2023 at 09:35:04AM +0200, Jan Beulich wrote: >> There's no point consuming two port-I/O slots. Even less so considering >> that some real hardware permits both ports to be accessed in one go, >> emulating of which requires there to be on

[linux-linus test] 181005: regressions - FAIL

2023-05-30 Thread osstest service owner
flight 181005 linux-linus real [real] flight 181009 linux-linus real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/181005/ http://logs.test-lab.xenproject.org/osstest/logs/181009/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run

[PATCH v3 00/16] tools/xenstore: more cleanups

2023-05-30 Thread Juergen Gross
Some more cleanups of Xenstore. Based on top of the previous Xenstore series "tools/xenstore: rework internal accounting". Changes in V2: - rebase - one small modification of patch 10 - added patches 11-13 Changes in V3: - rebase - modified patch 4 - added patches 10, 11 and 13 Juergen Gross (1

[PATCH v3 02/16] tools/xenstore: do some cleanup of hashtable.c

2023-05-30 Thread Juergen Gross
Do the following cleanups: - hashtable_count() isn't used at all, so remove it - replace prime_table_length and max_load_factor with macros - make hash() static - add a loadlimit() helper function - remove the /***/ lines between functions - do some style corrections Signed-off-by: Juergen Gross

[PATCH v3 01/16] tools/xenstore: verify command line parameters better

2023-05-30 Thread Juergen Gross
Add some more verification of command line parameters. Signed-off-by: Juergen Gross Acked-by: Julien Grall --- tools/xenstore/xenstored_core.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core

[PATCH v3 03/16] tools/xenstore: modify interface of create_hashtable()

2023-05-30 Thread Juergen Gross
The minsize parameter of create_hashtable() doesn't have any real use case for Xenstore, so drop it. For better talloc_report_full() diagnostic output add a name parameter to create_hashtable(). Signed-off-by: Juergen Gross --- V3: - make code more readable (Julien Grall) --- tools/xenstore/has

[PATCH v3 05/16] tools/xenstore: make some write limit functions static

2023-05-30 Thread Juergen Gross
Some wrl_*() functions are only used in xenstored_domain.c, so make them static. In order to avoid the need of forward declarations, move the whole function block to the start of the file. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_domain.c | 456 +++--- to

[PATCH v3 04/16] tools/xenstore: rename hashtable_insert() and let it return 0 on success

2023-05-30 Thread Juergen Gross
Today hashtable_insert() returns 0 in case of an error. Change that to let it return an errno value in the error case and 0 in case of success. In order to avoid any missed return value checks or related future backport errors, rename hashtable_insert() to hashtable_add(). Even if not used today,

[PATCH v3 06/16] tools/xenstore: switch write limiting to use millisecond time base

2023-05-30 Thread Juergen Gross
There is no need to keep struct wrl_timestampt, as it serves the same purpose as the more simple time base provided by get_now(). Move some more stuff from xenstored_domain.h into xenstored_domain.c as it is being used nowhere else. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core

[PATCH v3 08/16] tools/xenstore: remove unused events list

2023-05-30 Thread Juergen Gross
struct watch contains an unused struct list_head events. Remove it. Signed-off-by: Juergen Gross Acked-by: Julien Grall --- tools/xenstore/xenstored_watch.c | 5 - 1 file changed, 5 deletions(-) diff --git a/tools/xenstore/xenstored_watch.c b/tools/xenstore/xenstored_watch.c index e8eb35de

[PATCH v3 07/16] tools/xenstore: remove stale TODO file

2023-05-30 Thread Juergen Gross
The TODO file is not really helpful any longer. It contains only entries which no longer apply or it is unknown what they are meant for ("Dynamic/supply nodes", "Remove assumption that rename doesn't fail"). Signed-off-by: Juergen Gross Acked-by: Julien Grall --- tools/xenstore/TODO | 10 --

[PATCH v3 11/16] tools/libs/store: make libxenstore independent of utils.h

2023-05-30 Thread Juergen Gross
There is no real need for including tools/xenstore/utils.h from libxenstore, as only streq() and ARRAY_SIZE() are obtained via that header. streq() is just !strcmp(), and ARRAY_SIZE() is brought in via xen-tools/common-macros.h. Signed-off-by: Juergen Gross --- V3: - new patch --- tools/libs/st

[PATCH v3 10/16] tools/libs/store: use xen_list.h instead of xenstore/list.h

2023-05-30 Thread Juergen Gross
Replace the usage of the xenstore private list.h header with the common xen_list.h one. Signed-off-by: Juergen Gross --- V3: - new patch --- tools/libs/store/xs.c | 56 +-- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/tools/libs/store/xs

[PATCH v3 12/16] tools/xenstore: remove no longer needed functions from xs_lib.c

2023-05-30 Thread Juergen Gross
xs_daemon_tdb() in xs_lib.c is no longer used at all, so it can be removed. xs_domain_dev() and xs_write_all() are not used by xenstored, so they can be moved to tools/libs/store/xs.c. xs_daemon_rootdir() is used by xenstored only and it only calls xs_daemon_rundir(), so replace its use cases with

[PATCH v3 16/16] tools/xenstore: remove unused stuff from list.h

2023-05-30 Thread Juergen Gross
Remove the hlist defines/functions and the rcu related functions from tools/xenstore/list.h, as they are not used. Signed-off-by: Juergen Gross --- tools/xenstore/list.h | 227 -- 1 file changed, 227 deletions(-) diff --git a/tools/xenstore/list.h b/tools

[PATCH v3 15/16] tools/xenstore: split out rest of live update control code

2023-05-30 Thread Juergen Gross
Move the rest of live update related code from xenstored_control.c to a dedicated new source file. Signed-off-by: Juergen Gross --- tools/xenstore/Makefile.common | 2 +- tools/xenstore/xenstored_control.c | 409 - tools/xenstore/xenstored_control.h | 8 - too

[PATCH v3 14/16] tools/xenstore: split out environment specific live update code

2023-05-30 Thread Juergen Gross
Instead of using #ifdef in xenstored_control.c split out the code of environment specific functions (daemon or Mini-OS) to dedicated source files. Signed-off-by: Juergen Gross --- tools/xenstore/Makefile.common | 8 +- tools/xenstore/xenstored_control.c | 253 +-

[PATCH v3 13/16] tools/xenstore: replace xs_lib.c with a header

2023-05-30 Thread Juergen Gross
Instead of including the same small C source in multiple binaries from 2 source directories, use a header file with inline functions as a replacement. As some of the functions are exported by libxenstore, rename the inline functions from xs_*() do xenstore_*() and add xs_*() wrappers to libxenstor

[PATCH v3 09/16] tools/xenstore: remove support of file backed data base

2023-05-30 Thread Juergen Gross
In order to prepare the replacement of TDB with direct accessible nodes in memory, remove the support for a file backed data base. This allows to remove xs_tdb_dump, too. Signed-off-by: Juergen Gross --- .gitignore | 1 - tools/xenstore/Makefile | 5 +- tools/xens

[qemu-mainline test] 181006: regressions - FAIL

2023-05-30 Thread osstest service owner
flight 181006 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/181006/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64 6 xen-buildfail REGR. vs. 180691 build-arm64-xsm

Re: [PATCH 1/4] x86/spec-ctrl: Rename retpoline_safe() to retpoline_calculations()

2023-05-30 Thread Jan Beulich
On 26.05.2023 13:06, Andrew Cooper wrote: > This is prep work, split out to simply the diff on the following change. > > * Rename to retpoline_calculations(), and call unconditionally. It is >shortly going to synthesize missing enumerations required for guest safety. > * For Broadwell, stor

Re: [PATCH] x86/vPIC: register only one ELCR handler instance

2023-05-30 Thread Roger Pau Monné
On Tue, May 30, 2023 at 10:48:02AM +0200, Jan Beulich wrote: > On 29.05.2023 10:39, Roger Pau Monné wrote: > > On Fri, May 26, 2023 at 09:35:04AM +0200, Jan Beulich wrote: > >> There's no point consuming two port-I/O slots. Even less so considering > >> that some real hardware permits both ports to

Re: [PATCH RFC v2] vPCI: account for hidden devices

2023-05-30 Thread Roger Pau Monné
On Tue, May 30, 2023 at 10:45:09AM +0200, Jan Beulich wrote: > On 29.05.2023 10:08, Roger Pau Monné wrote: > > On Thu, May 25, 2023 at 05:30:54PM +0200, Jan Beulich wrote: > >> On 25.05.2023 17:02, Roger Pau Monné wrote: > >>> On Thu, May 25, 2023 at 04:39:51PM +0200, Jan Beulich wrote: > On 2

[PATCH 00/11] tools/xenstore: drop TDB

2023-05-30 Thread Juergen Gross
Using TDB for storing the Xenstore nodes is adding more complexity instead of removing it. With keeping the data in memory only, the main reason for using TDB has disappeared. This series is replacing TDB with a hashlist referencing directly individually allocated Xenstore nodes. The series is ba

[PATCH 01/11] tools/xenstore: explicitly specify create or modify for tdb_store()

2023-05-30 Thread Juergen Gross
Instead of using TDB_REPLACE for either creating or modifying a TDB entry, use either TDB_INSERT or TDB_MODIFY when calling tdb_store(). At higher function levels use the abstract flag values NODE_CREATE and NODE_MODIFY. This is for preparing to get rid of TDB. Signed-off-by: Juergen Gross ---

[PATCH 03/11] tools/xenstore: let transaction_prepend() return the name for access

2023-05-30 Thread Juergen Gross
Instead of setting the TDB key for accessing the node in the data base, let transaction_prepend() return the associated name instead. This is in preparation to replace TDB with a more simple data storage. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c| 4 +++- tools/x

[PATCH 02/11] tools/xenstore: replace key in struct node with data base name

2023-05-30 Thread Juergen Gross
Instead of storing the TDB key in struct node, only store the name of the node used to access it in the data base. Associated with that change replace the key parameter of access_node() with the equivalent db_name. This is in preparation to replace TDB with a more simple data storage. Signed-off

[PATCH 05/11] tools/xenstore: rename do_tdb_write() and change parameter type

2023-05-30 Thread Juergen Gross
Rename do_tdb_write() to db_write() and replace the key parameter with db_name specifying the name of the node in the data base, and the data parameter with a data pointer and a length. Do the same key parameter type change for write_node_raw(), too. This is in preparation to replace TDB with a m

[PATCH 04/11] tools/xenstore: rename do_tdb_delete() and change parameter type

2023-05-30 Thread Juergen Gross
Rename do_tdb_delete() to db_delete() and replace the key parameter with db_name specifying the name of the node in the data base. This is in preparation to replace TDB with a more simple data storage. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c| 31

[PATCH 06/11] tools/xenstore: switch get_acc_data() to use name instead of key

2023-05-30 Thread Juergen Gross
Eliminate further TDB_DATA usage by switching get_acc_data() and get_acc_domid() from a TDB key to the name of the node in the data base as a parameter. This is in preparation to replace TDB with a more simple data storage. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c | 26 +

[PATCH 08/11] tools/xenstore: make hashtable key and value parameters const

2023-05-30 Thread Juergen Gross
The key is never modified by hashtable code, so it should be marked as const. Signed-off-by: Juergen Gross --- tools/xenstore/hashtable.c | 5 +++-- tools/xenstore/hashtable.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/xenstore/hashtable.c b/tools/xenstore/has

Re: [PATCH 1/4] x86/spec-ctrl: Rename retpoline_safe() to retpoline_calculations()

2023-05-30 Thread Andrew Cooper
On 30/05/2023 10:07 am, Jan Beulich wrote: > On 26.05.2023 13:06, Andrew Cooper wrote: >> This is prep work, split out to simply the diff on the following change. >> >> * Rename to retpoline_calculations(), and call unconditionally. It is >>shortly going to synthesize missing enumerations req

[PATCH 07/11] tools/xenstore: add wrapper for tdb_fetch()

2023-05-30 Thread Juergen Gross
Add a wrapper function for tdb_fetch taking the name of the node in the data base as a parameter. Let it return a data pointer and the length of the data via a length pointer provided as additional parameter. This enables to make set_tdb_key() static again. This is in preparation to replace TDB w

[PATCH 10/11] tools/xenstore: drop use of tdb

2023-05-30 Thread Juergen Gross
Today all Xenstore nodes are stored in a TDB data base. This data base has several disadvantages: - it is using a fixed sized hash table, resulting in high memory overhead for small installations with only very few VMs, and a rather large performance hit for systems with lots of VMs due to man

[PATCH 09/11] tools/xenstore: add hashtable_replace() function

2023-05-30 Thread Juergen Gross
For an effective way to replace a hashtable entry add a new function hashtable_replace(). While at it let hashtable_add() fail if an entry with the specified key does already exist. This is in preparation to replace TDB with a more simple data storage. Signed-off-by: Juergen Gross --- tools/xe

[PATCH 11/11] tools/xenstore: remove tdb code

2023-05-30 Thread Juergen Gross
Now that TDB isn't used anymore, remove it. Signed-off-by: Juergen Gross --- tools/xenstore/Makefile.common |2 +- tools/xenstore/tdb.c | 1748 tools/xenstore/tdb.h | 132 --- 3 files changed, 1 insertion(+), 1881 deletions(-) delete mod

Re: [PATCH 2/4] x86/spec-ctrl: Synthesize RSBA/RRSBA bits with older microcode

2023-05-30 Thread Jan Beulich
On 26.05.2023 13:06, Andrew Cooper wrote: > @@ -687,6 +697,32 @@ static bool __init retpoline_calculations(void) > if ( safe ) > return true; > > +/* > + * The meaning of the RSBA and RRSBA bits have evolved over time. The > + * agreed upon meaning at the time of writin

Re: [PATCH 3/4] x86/cpu-policy: Rearrange guest_common_default_feature_adjustments()

2023-05-30 Thread Jan Beulich
On 26.05.2023 13:06, Andrew Cooper wrote: > This is prep work, split out to simply the diff on the following change. > > * Split the INTEL check out of the IvyBridge RDRAND check, as the former will >be reused. > * Use asm/intel-family.h to remove a raw 0x3a model number. > > No functional

Re: [patch v3 31/36] x86/apic: Provide cpu_primary_thread mask

2023-05-30 Thread Thomas Gleixner
On Mon, May 29 2023 at 23:31, Kirill A. Shutemov wrote: > Aaand the next patch that breaks TDX boot is... > > x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable > it > > Disabling parallel bringup helps. I didn't look closer yet. If you have > an idea let me know. So h

Re: [patch v3 31/36] x86/apic: Provide cpu_primary_thread mask

2023-05-30 Thread Thomas Gleixner
On Tue, May 30 2023 at 03:54, Kirill A. Shutemov wrote: > On Mon, May 29, 2023 at 11:31:29PM +0300, Kirill A. Shutemov wrote: >> Disabling parallel bringup helps. I didn't look closer yet. If you have >> an idea let me know. > > Okay, it crashes around .Lread_apicid due to touching MSRs that trigge

Re: [PATCH 4/4] x86/cpu-policy: Derive {,R}RSBA for guest policies

2023-05-30 Thread Jan Beulich
On 26.05.2023 13:06, Andrew Cooper wrote: > The RSBA bit, "RSB Alternative", means that the RSB may use alternative > predictors when empty. From a practical point of view, this mean "Retpoline > not safe". > > Enhanced IBRS (officially IBRS_ALL in Intel's docs, previously IBRS_ATT) is a > statem

Re: [PATCH RFC v2] vPCI: account for hidden devices

2023-05-30 Thread Jan Beulich
On 30.05.2023 11:12, Roger Pau Monné wrote: > On Tue, May 30, 2023 at 10:45:09AM +0200, Jan Beulich wrote: >> On 29.05.2023 10:08, Roger Pau Monné wrote: >>> On Thu, May 25, 2023 at 05:30:54PM +0200, Jan Beulich wrote: On 25.05.2023 17:02, Roger Pau Monné wrote: > On Thu, May 25, 2023 at 0

Re: [RFC PATCH v1 0/9] Hypervisor-Enforced Kernel Integrity

2023-05-30 Thread Mickaël Salaün
On 25/05/2023 20:34, Trilok Soni wrote: On 5/25/2023 6:25 AM, Mickaël Salaün wrote: On 24/05/2023 23:04, Trilok Soni wrote: On 5/5/2023 8:20 AM, Mickaël Salaün wrote: Hi, This patch series is a proof-of-concept that implements new KVM features (extended page tracking, MBEC support, CR pinn

Re: [PATCH 2/3] x86: Add support for AMD's Automatic IBRS

2023-05-30 Thread Alejandro Vallejo
On Tue, May 30, 2023 at 10:25:36AM +0200, Jan Beulich wrote: > On 26.05.2023 17:00, Alejandro Vallejo wrote: > > --- a/xen/arch/x86/smpboot.c > > +++ b/xen/arch/x86/smpboot.c > > @@ -376,6 +376,9 @@ void start_secondary(void *unused) > > { > > wrmsrl(MSR_SPEC_CTRL, default_xen_spec_ct

Re: [PATCH 2/4] x86/spec-ctrl: Synthesize RSBA/RRSBA bits with older microcode

2023-05-30 Thread Andrew Cooper
On 30/05/2023 10:18 am, Jan Beulich wrote: > On 26.05.2023 13:06, Andrew Cooper wrote: >> @@ -687,6 +697,32 @@ static bool __init retpoline_calculations(void) >> if ( safe ) >> return true; >> >> +/* >> + * The meaning of the RSBA and RRSBA bits have evolved over time. The

Re: [XEN PATCH 13/15] build: fix compile.h compiler version command line

2023-05-30 Thread Jan Beulich
On 24.05.2023 11:43, Luca Fancellu wrote: > > >> On 23 May 2023, at 17:38, Anthony PERARD wrote: >> >> CFLAGS is just from Config.mk, instead use the flags used to build >> Xen. >> >> Signed-off-by: Anthony PERARD >> --- >> >> Notes: >>I don't know if CFLAGS is even useful there, just --ver

Re: [PATCH 2/3] x86: Add support for AMD's Automatic IBRS

2023-05-30 Thread Alejandro Vallejo
On Fri, May 26, 2023 at 04:00:43PM +0100, Alejandro Vallejo wrote: > diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c > index 74e3915a4d..09cfef2676 100644 > --- a/xen/arch/x86/setup.c > +++ b/xen/arch/x86/setup.c > @@ -2036,6 +2036,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)

Re: [PATCH 2/4] x86/spec-ctrl: Synthesize RSBA/RRSBA bits with older microcode

2023-05-30 Thread Jan Beulich
On 30.05.2023 12:00, Andrew Cooper wrote: > On 30/05/2023 10:18 am, Jan Beulich wrote: >> On 26.05.2023 13:06, Andrew Cooper wrote: >>> @@ -687,6 +697,32 @@ static bool __init retpoline_calculations(void) >>> if ( safe ) >>> return true; >>> >>> +/* >>> + * The meaning of th

Re: [PATCH v9 0/5] enable MMU for RISC-V

2023-05-30 Thread Jan Beulich
On 25.05.2023 17:28, Oleksii Kurochko wrote: > Oleksii Kurochko (5): > xen/riscv: add VM space layout > xen/riscv: introduce setup_initial_pages > xen/riscv: align __bss_start > xen/riscv: setup initial pagetables > xen/riscv: remove dummy_bss variable While the series is now okay from m

Re: [PATCH 2/3] xen/misra: xen-analysis.py: Fix latent bug

2023-05-30 Thread Jan Beulich
On 19.05.2023 11:30, Luca Fancellu wrote: > Currenly there is a latent bug that is not triggered because > the function cppcheck_merge_txt_fragments is called with the > parameter strip_paths having a list of only one element. > > The bug is that the split function should not be in the > loop for

Re: [patch v3 31/36] x86/apic: Provide cpu_primary_thread mask

2023-05-30 Thread Thomas Gleixner
On Tue, May 30 2023 at 11:26, Thomas Gleixner wrote: > On Tue, May 30 2023 at 03:54, Kirill A. Shutemov wrote: >> On Mon, May 29, 2023 at 11:31:29PM +0300, Kirill A. Shutemov wrote: >>> Disabling parallel bringup helps. I didn't look closer yet. If you have >>> an idea let me know. >> >> Okay, it c

Re: [XEN PATCH 14/15] Config.mk: move $(cc-option, ) to config/compiler-testing.mk

2023-05-30 Thread Jan Beulich
On 23.05.2023 18:38, Anthony PERARD wrote: > In xen/, it isn't necessary to include Config.mk in every Makefile in > subdirectories as nearly all necessary variables should be calculated > in xen/Makefile. But some Makefile make use of the macro $(cc-option,) > that is only available in Config.mk.

[patch] x86/realmode: Make stack lock work in trampoline_compat()

2023-05-30 Thread Thomas Gleixner
The stack locking and stack assignment macro LOAD_REALMODE_ESP fails to work when invoked from the 64bit trampoline entry point: trampoline_start64 trampoline_compat LOAD_REALMODE_ESP <- lock Accessing tr_lock is only possible from 16bit mode. For the compat entry point this needs to be pa_

Re: [XEN PATCH 15/15] build: remove Config.mk include from Rules.mk

2023-05-30 Thread Jan Beulich
On 23.05.2023 18:38, Anthony PERARD wrote: > Everything needed to build the hypervisor should already be configured > by "xen/Makefile", thus Config.mk shouldn't be needed. "... by xen/Rules.mk." (Or else it sounds as if yo're removing its use altogether.) > --- a/xen/Makefile > +++ b/xen/Makefil

[ovmf test] 181011: all pass - PUSHED

2023-05-30 Thread osstest service owner
flight 181011 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/181011/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 0f9283429dd487deeeb264ee5670551d596fc208 baseline version: ovmf 9d9761af50e538d983e00

Re: [PATCH RFC v2] vPCI: account for hidden devices

2023-05-30 Thread Roger Pau Monné
On Tue, May 30, 2023 at 11:44:52AM +0200, Jan Beulich wrote: > On 30.05.2023 11:12, Roger Pau Monné wrote: > > On Tue, May 30, 2023 at 10:45:09AM +0200, Jan Beulich wrote: > >> On 29.05.2023 10:08, Roger Pau Monné wrote: > >>> On Thu, May 25, 2023 at 05:30:54PM +0200, Jan Beulich wrote: > On 2

Re: [patch] x86/realmode: Make stack lock work in trampoline_compat()

2023-05-30 Thread Kirill A. Shutemov
On Tue, May 30, 2023 at 12:46:22PM +0200, Thomas Gleixner wrote: > The stack locking and stack assignment macro LOAD_REALMODE_ESP fails to > work when invoked from the 64bit trampoline entry point: > > trampoline_start64 > trampoline_compat > LOAD_REALMODE_ESP <- lock > > Accessing tr_lock

[PATCH v1] tools: fix make rpmball

2023-05-30 Thread Olaf Hering
Commit 438c5ffa44e99cceb574c0f9946aacacdedd2952 ("rpmball: Adjust to new rpm, do not require --force") attempted to handle stricter directory permissions in newer distributions. This introduced a few issues: - /boot used to be a constant prior commit 6475d700055fa952f7671cee982a23de2f5e4a7c ("us

Re: [PATCH v9 0/5] enable MMU for RISC-V

2023-05-30 Thread Oleksii
On Tue, 2023-05-30 at 12:23 +0200, Jan Beulich wrote: > On 25.05.2023 17:28, Oleksii Kurochko wrote: > > Oleksii Kurochko (5): > >   xen/riscv: add VM space layout > >   xen/riscv: introduce setup_initial_pages > >   xen/riscv: align __bss_start > >   xen/riscv: setup initial pagetables > >   xen/r

Re: [patch v3 31/36] x86/apic: Provide cpu_primary_thread mask

2023-05-30 Thread Kirill A. Shutemov
On Tue, May 30, 2023 at 12:34:45PM +0200, Thomas Gleixner wrote: > On Tue, May 30 2023 at 11:26, Thomas Gleixner wrote: > > On Tue, May 30 2023 at 03:54, Kirill A. Shutemov wrote: > >> On Mon, May 29, 2023 at 11:31:29PM +0300, Kirill A. Shutemov wrote: > >>> Disabling parallel bringup helps. I didn

[PATCH] xen/include/public: fix 9pfs xenstore path description

2023-05-30 Thread Juergen Gross
In xen/include/public/io/9pfs.h the name of the Xenstore backend node "security-model" should be "security_model", as this is how the Xen tools are creating it and qemu is reading it. Fixes: ad58142e73a9 ("xen/public: move xenstore related doc into 9pfs.h") Fixes: cf1d2d22fdfd ("docs/misc: Xen tra

Re: [PATCH v2 1/2] x86/mm: add API for marking only part of a MMIO page read only

2023-05-30 Thread Jan Beulich
On 05.05.2023 23:25, Marek Marczykowski-Górecki wrote: > In some cases, only few registers on a page needs to be write-protected. > Examples include USB3 console (64 bytes worth of registers) or MSI-X's > PBA table (which doesn't need to span the whole table either), although > in the latter case t

Re: [PATCH v2 2/2] drivers/char: Use sub-page ro API to make just xhci dbc cap RO

2023-05-30 Thread Jan Beulich
On 05.05.2023 23:25, Marek Marczykowski-Górecki wrote: > Not the whole page, which may contain other registers too. In fact > on Tiger Lake and newer (at least), this page do contain other registers > that Linux tries to use. Please can you clarify whether this is with spec or an erratum? I ask no

Re: [PATCH] xen/include/public: fix 9pfs xenstore path description

2023-05-30 Thread Jason Andryuk
On Tue, May 30, 2023 at 7:48 AM Juergen Gross wrote: > > In xen/include/public/io/9pfs.h the name of the Xenstore backend node > "security-model" should be "security_model", as this is how the Xen > tools are creating it and qemu is reading it. > > Fixes: ad58142e73a9 ("xen/public: move xenstore r

[patch] x86/smpboot: Disable parallel bootup if cc_vendor != NONE

2023-05-30 Thread Thomas Gleixner
The decision to allow parallel bringup of secondary CPUs checks CC_ATTR_GUEST_STATE_ENCRYPT to detect encrypted guests. Those cannot use parallel bootup because accessing the local APIC is intercepted and raises a #VC or #VE, which cannot be handled at that point. The check works correctly, but on

Re: [PATCH 2/3] xen/misra: xen-analysis.py: Fix latent bug

2023-05-30 Thread Luca Fancellu
> On 30 May 2023, at 11:32, Jan Beulich wrote: > > On 19.05.2023 11:30, Luca Fancellu wrote: >> Currenly there is a latent bug that is not triggered because >> the function cppcheck_merge_txt_fragments is called with the >> parameter strip_paths having a list of only one element. >> >> The bu

Re: [XEN PATCH 13/15] build: fix compile.h compiler version command line

2023-05-30 Thread Luca Fancellu
> On 30 May 2023, at 11:14, Jan Beulich wrote: > > On 24.05.2023 11:43, Luca Fancellu wrote: >> >> >>> On 23 May 2023, at 17:38, Anthony PERARD wrote: >>> >>> CFLAGS is just from Config.mk, instead use the flags used to build >>> Xen. >>> >>> Signed-off-by: Anthony PERARD >>> --- >>> >>>

Re: [patch] x86/smpboot: Disable parallel bootup if cc_vendor != NONE

2023-05-30 Thread Kirill A. Shutemov
On Tue, May 30, 2023 at 02:09:17PM +0200, Thomas Gleixner wrote: > The decision to allow parallel bringup of secondary CPUs checks > CC_ATTR_GUEST_STATE_ENCRYPT to detect encrypted guests. Those cannot use > parallel bootup because accessing the local APIC is intercepted and raises > a #VC or #VE,

[PATCH v3] vPCI: account for hidden devices

2023-05-30 Thread Jan Beulich
Hidden devices (e.g. an add-in PCI serial card used for Xen's serial console) are associated with DomXEN, not Dom0. This means that while looking for overlapping BARs such devices cannot be found on Dom0's list of devices; DomXEN's list also needs to be scanned. Suppress vPCI init altogether for r

Re: [PATCH v2 1/2] x86: annotate entry points with type and size

2023-05-30 Thread Roger Pau Monné
On Tue, May 30, 2023 at 10:06:27AM +0200, Jan Beulich wrote: > On 29.05.2023 15:34, Roger Pau Monné wrote: > > On Tue, May 23, 2023 at 01:30:51PM +0200, Jan Beulich wrote: > >> Note that the FB-label in autogen_stubs() cannot be converted just yet: > >> Such labels cannot be used with .type. We cou

[xen-unstable test] 181007: tolerable FAIL

2023-05-30 Thread osstest service owner
flight 181007 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/181007/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-i386-examine-bios 6 xen-install fail in 180992 pass in 181007 test-amd64-amd64-xl-qemut-debian

Re: [PATCH 4/4] x86/cpu-policy: Derive {,R}RSBA for guest policies

2023-05-30 Thread Andrew Cooper
On 30/05/2023 10:40 am, Jan Beulich wrote: > On 26.05.2023 13:06, Andrew Cooper wrote: >> The RSBA bit, "RSB Alternative", means that the RSB may use alternative >> predictors when empty. From a practical point of view, this mean "Retpoline >> not safe". >> >> Enhanced IBRS (officially IBRS_ALL in

Re: [PATCH v3] vPCI: account for hidden devices

2023-05-30 Thread Roger Pau Monné
On Tue, May 30, 2023 at 02:38:56PM +0200, Jan Beulich wrote: > Hidden devices (e.g. an add-in PCI serial card used for Xen's serial > console) are associated with DomXEN, not Dom0. This means that while > looking for overlapping BARs such devices cannot be found on Dom0's list > of devices; DomXEN'

[PATCH v2 2/3] x86: Expose Automatic IBRS to guests

2023-05-30 Thread Alejandro Vallejo
Expose AutoIBRS to HVM guests. EFER is swapped by VMRUN, so Xen only has to make sure writes to EFER.AIBRSE are gated on the feature being exposed. Also hide EFER.AIBRSE from PV guests as they have no say in the matter. Signed-off-by: Alejandro Vallejo Reviewed-by: Andrew Cooper --- v2: * Mov

[PATCH v2 0/3] Add Automatic IBRS support

2023-05-30 Thread Alejandro Vallejo
v2: * Renamed AUTOMATIC to AUTO * Style change in xen-cpuid.c * Swapped patches 2 and 3 * Modified trampoline_efer from the BSP so APs use it during boot and S3 wakeups pick it up. * Avoid the delay setting AutoIBRS Adds support for AMD's Automatic IBRS. It's a set-and-forget feature

[PATCH v2 1/3] x86: Add bit definitions for Automatic IBRS

2023-05-30 Thread Alejandro Vallejo
This is an AMD feature to reduce the IBRS handling overhead. Once enabled, processes running at CPL=0 are automatically IBRS-protected even if SPEC_CTRL.IBRS is not set. Furthermore, the RAS/RSB is cleared on VMEXIT. The feature is exposed in CPUID and toggled in EFER. Signed-off-by: Alejandro Va

[PATCH v2 3/3] x86: Add support for AMD's Automatic IBRS

2023-05-30 Thread Alejandro Vallejo
In cases where AutoIBRS is supported by the host: * Prefer AutoIBRS to retpolines as BTI mitigation in heuristics calculations. * Always enable AutoIBRS if IBRS is chosen as a BTI mitigation. * Avoid stuffing the RAS/RSB on VMEXIT if AutoIBRS is enabled. Signed-off-by: Alejandro Vallejo --- v2

Re: [PATCH v3] vPCI: account for hidden devices

2023-05-30 Thread Jan Beulich
On 30.05.2023 15:36, Roger Pau Monné wrote: > On Tue, May 30, 2023 at 02:38:56PM +0200, Jan Beulich wrote: >> Hidden devices (e.g. an add-in PCI serial card used for Xen's serial >> console) are associated with DomXEN, not Dom0. This means that while >> looking for overlapping BARs such devices can

  1   2   >