Re: [Xen-devel] [PATCH] xen-netfront: Fix hang on device removal

2018-04-19 Thread Simon Gaiser
Jason Andryuk: > On Thu, Apr 19, 2018 at 2:10 PM, Simon Gaiser > wrote: >> Jason Andryuk: >>> A toolstack may delete the vif frontend and backend xenstore entries >>> while xen-netfront is in the removal code path. In that case, the >>> checks fo

Re: [Xen-devel] [PATCH] xen-netfront: Fix hang on device removal

2018-04-19 Thread Simon Gaiser
Jason Andryuk: > A toolstack may delete the vif frontend and backend xenstore entries > while xen-netfront is in the removal code path. In that case, the > checks for xenbus_read_driver_state would return XenbusStateUnknown, and > xennet_remove would hang indefinitely. This hang prevents system >

[PATCH] xen: xenbus_dev_frontend: Really return response string

2018-03-14 Thread Simon Gaiser
xenbus_command_reply() did not actually copy the response string and leaked stack content instead. Fixes: 9a6161fe73bd ("xen: return xenstore command failures via response instead of rc") Signed-off-by: Simon Gaiser --- PS: AFAICS this is not a security issue since /dev/xen/xenbus i

[PATCH v2 3/3] xen: xenbus_dev_frontend: Verify body of XS_TRANSACTION_END

2018-03-14 Thread Simon Gaiser
By guaranteeing that the argument of XS_TRANSACTION_END is valid we can assume that the transaction has been closed when we get an XS_ERROR response from xenstore (Note that we already verify that it's a valid transaction id). Signed-off-by: Simon Gaiser --- drivers/xen/x

[PATCH v2 2/3] xen: xenbus: Catch closing of non existent transactions

2018-03-14 Thread Simon Gaiser
Users of the xenbus functions should never close a non existent transaction (for example by trying to closing the same transaction twice) but better catch it in xs_request_exit() than to corrupt the reference counter. Signed-off-by: Simon Gaiser --- drivers/xen/xenbus/xenbus_xs.c | 4 +++- 1

[PATCH v2 1/3] xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling

2018-03-14 Thread Simon Gaiser
have sent XS_TRANSACTION_END once regardless of the return code. Cc: # 4.11 Fixes: fd8aa9095a95 ("xen: optimize xenbus driver for multiple concurrent xenstore accesses") Signed-off-by: Simon Gaiser --- drivers/xen/xenbus/xenbus_dev_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

Re: [PATCH 1/2] xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling

2018-03-02 Thread Simon Gaiser
Juergen Gross: > On 20/02/18 05:56, Simon Gaiser wrote: >> Juergen Gross: >>> On 07/02/18 23:22, Simon Gaiser wrote: >>>> Commit fd8aa9095a95 ("xen: optimize xenbus driver for multiple >>>> concurrent xenstore accesses") made a subtle change

Re: [PATCH] x86/xen: Calculate __max_logical_packages on PV domains

2018-02-27 Thread Simon Gaiser
smpboot: Fix __max_logical_packages estimate") >> Signed-off-by: Prarit Bhargava >> Tested-and-reported-by: Simon Gaiser >> Cc: Thomas Gleixner >> Cc: Ingo Molnar >> Cc: "H. Peter Anvin" >> Cc: x...@kernel.org >> Cc: Boris Ostrovsky &g

Re: [PATCH 1/2] xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling

2018-02-19 Thread Simon Gaiser
Juergen Gross: > On 07/02/18 23:22, Simon Gaiser wrote: >> Commit fd8aa9095a95 ("xen: optimize xenbus driver for multiple >> concurrent xenstore accesses") made a subtle change to the semantic of >> xenbus_dev_request_and_reply() and xenbus_transaction_end(). >&

Re: [PATCH 2/2] xen: xenbus: WARN_ON XS_TRANSACTION_{START,END} misuse

2018-02-10 Thread Simon Gaiser
Boris Ostrovsky: > On 02/07/2018 05:22 PM, Simon Gaiser wrote: >> +users_old = xs_state_users; >> xs_state_users--; >> if ((req->type == XS_TRANSACTION_START && req->msg.type == XS_ERROR) || >> req->type == XS_TRANSACTION_EN

[PATCH 2/2] xen: xenbus: WARN_ON XS_TRANSACTION_{START,END} misuse

2018-02-07 Thread Simon Gaiser
As the previous commit shows it's quite easy to confuse the transaction reference counting by ending a transaction twice. So at least try to detect and report it. Signed-off-by: Simon Gaiser --- drivers/xen/xenbus/xenbus_xs.c | 9 + 1 file changed, 9 insertions(+) diff --git a/dr

[PATCH 1/2] xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling

2018-02-07 Thread Simon Gaiser
have sent XS_TRANSACTION_END once regardless of the return code. Cc: # 4.11 Fixes: fd8aa9095a95 ("xen: optimize xenbus driver for multiple concurrent xenstore accesses") Signed-off-by: Simon Gaiser --- drivers/xen/xenbus/xenbus_dev_frontend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH] xen: Fix {set,clear}_foreign_p2m_mapping on autotranslating guests

2018-02-07 Thread Simon Gaiser
n pure pv paths") Signed-off-by: Simon Gaiser Reviewed-by: Juergen Gross --- arch/x86/xen/p2m.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c index 13b4f19b9131..159a897151d6 100644 --- a/arch/x86/xen/p2m.c +++ b/arch/x86/xen/p2m.c @@

Re: [v6,3/3] x86/smpboot: Fix __max_logical_packages estimate

2018-02-07 Thread Simon Gaiser
Prarit Bhargava: > On 02/07/2018 01:44 PM, Simon Gaiser wrote: >> Prarit Bhargava: >>> A system booted with a small number of cores enabled per package >>> panics because the estimate of __max_logical_packages is too low. >>> This occurs when the total number

Re: [v6,3/3] x86/smpboot: Fix __max_logical_packages estimate

2018-02-07 Thread Simon Gaiser
Prarit Bhargava: > A system booted with a small number of cores enabled per package > panics because the estimate of __max_logical_packages is too low. > This occurs when the total number of active cores across all packages > is less than the maximum core count for a single package. > > ie) On a 4