From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83E9FC43458 for ; Wed, 1 Jul 2026 13:48:56 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.1349970.1607553 (Exim 4.92) (envelope-from ) id 1wevIt-0005Gr-Ew; Wed, 01 Jul 2026 13:48:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 1349970.1607553; Wed, 01 Jul 2026 13:48:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wevIt-0005Gk-Bp; Wed, 01 Jul 2026 13:48:39 +0000 Received: by outflank-mailman (input) for mailman id 1349970; Wed, 01 Jul 2026 13:48:38 +0000 Received: from mx.expurgate.net ([194.145.224.10]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1wevIs-0005GZ-Bc for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 13:48:38 +0000 Received: from mx.expurgate.net (helo=localhost) by mx.expurgate.net with esmtp id 1wevIr-003xrh-C9 for xen-devel@lists.xenproject.org; Wed, 01 Jul 2026 15:48:37 +0200 Received: from [10.42.69.5] (helo=localhost) by localhost with ESMTP (eXpurgate MTA 0.9.1) (envelope-from ) id 6a451ab1-5cb7-0a2a0a5109dd-0a2a4505ba8e-14 for ; Wed, 01 Jul 2026 15:48:37 +0200 Received: from [209.85.128.54] (helo=mail-wm1-f54.google.com) by tlsNG-c201ff.mxtls.expurgate.net with ESMTPS (eXpurgate 4.57.1) (envelope-from ) id 6a451ab4-3cb2-0a2a45050019-d1558036dcae-3 for ; Wed, 01 Jul 2026 15:48:36 +0200 Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-493a97fad2fso6087765e9.0 for ; Wed, 01 Jul 2026 06:48:36 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493be4d1f1asm83687285e9.7.2026.07.01.06.48.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jul 2026 06:48:35 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Authentication-Results: eu.smtp.expurgate.cloud; dkim=pass header.s=google header.d=suse.com header.i="@suse.com" header.h="Content-Transfer-Encoding:In-Reply-To:Autocrypt:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1782913716; x=1783518516; darn=lists.xenproject.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=FZJ7FVfbTz+w5KSCQNEAopHFenppAWwmNKWbesF+99g=; b=KJ2WNXdZN9npSCi74F/z7yJeslgTUv4kHRDRD/4FakqmyqvbTUkR8vnM2Y0+XmvZpy GnGYmtULYo1gZYG/R99ANm6up95MqidKrhFI7JzbN7mBSjJ/jXqqeCseRc76ZbWJgOlq WR9pXjla4J2/MDEnl9fy9Fqcc3DRzeZEwa9cP6qHV6ivU4aSHcPaavKcdYDNCs04RWUM jlWKwti3mABtyt4TtT/l/JkVsK6oYq7uyA3BE4yWwV2B9Mu39GanhIX4eXZSIiuda6jh r4RxszjL6hYyB1EJxSfX7xcQ6fNR+poIw1OrDBrE90Rnp0W70e174xH6BzATlZa8CNKW yeDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782913716; x=1783518516; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FZJ7FVfbTz+w5KSCQNEAopHFenppAWwmNKWbesF+99g=; b=nJViyERRfG0ySt5QFu5Ehzd17BOFXoWrc1hs56MtyWEjyow6H7ryxP9mrdlV00pPr8 zoE7hThnb0JRbmBnjLIndeMxlPzA+cjL21sBtzirXzkSyE6HTm0PiDatIZK60GXlZ7NO b66OvMuqdLAEGsbGHBr14ioPeo0pvgQMEmGlDdwwq5HVo6OZm4w5RS+8JhNMEhZIV1Es RRzqHkZsZxClmLph5aw/gwRixIPCfawmAHzwMXw8dS1GrMq7Y0ci6EnmQQQUOljkGhDq E/G2Yiz2SYNikpBUdpq5Eo4zeX+Oi0KxEB1x/jmoqLFCT3ZPrbjv2IyRNflgEcVGYqHM 09lw== X-Forwarded-Encrypted: i=1; AFNElJ/03R8LOymGd+iDzy+O8REA+rJem8ERJLcoQvZeJpu9KfduHwimuTd0aemH9PgJELbqzrgLpVBos9s=@lists.xenproject.org X-Gm-Message-State: AOJu0YyCNDw+oi30emjFHH7me8b8s2L7E1GQ9wooIFS6VZYzkEvxd+aD eabc8d6eirmg8KMHAXk07HmqudgJXDW9PT/WNMI2xOVc9rSjmiMcQFYUKcbZANt+sg== X-Gm-Gg: AfdE7cnYPQ91jG6EYP2r31ZW07EDxNaCfrsBsniksEmRTL0iPAOCVFIgFQU8nFuD7q0 jjhPZqFTjXBN1X/bMdoe+e+lDJS8oo5yxKOz+3wBeCNuraxTKBfK/bBZAQEb1+6GzZvidzoj6+c nTKbFCBd++ZWRI1mDllw21FnfY9igblO06SaEHMvHnpma2qwFrJUD+SI7UQDhBCQ1OGdAzYY1F7 Vy383Mi/j5fg3h2emYFNn0qZNh/l7wHZnUVb3MoWwWB7xwDzVMQMXyEMioR70K2eWF1XdLUryWT nOFPsnz5j1HO7g1syYYsdPfwMry2iVTZHVYBL44YNwetXQhQT8CrXVPz6W9o2UHn0i4r5GqJaOC CAIYrZwCF3/r8Zssrdo9FKjbW5hGfi9LN/upLq2JqjA8k+sPP5SUYzwnGdyf3CSwUlVypvRWuOg ZJWu9WNyklhCjMXG5JfNQb9Qv6wtjww9j8fvaRFA8LRF0dCgXlGlIXeXqSJc4XOzAn0NFsK7aVV M6q X-Received: by 2002:a05:600c:c093:b0:493:bb4d:4dfe with SMTP id 5b1f17b1804b1-493c3cf0d10mr11006325e9.23.1782913716355; Wed, 01 Jul 2026 06:48:36 -0700 (PDT) Message-ID: Date: Wed, 1 Jul 2026 15:48:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/3] Change XEN_DOMCTL_setvcpuaffinity interface To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= Cc: Anthony PERARD , Dario Faggioli , George Dunlap , Andrew Cooper , Michal Orzel , Julien Grall , =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= , Stefano Stabellini , xen-devel@lists.xenproject.org References: <20260701111606.4063972-1-jgross@suse.com> <4e16c1eb-e1ff-4d7a-bfa8-223d357716ee@suse.com> Content-Language: en-US From: Jan Beulich Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32X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xG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-purgate-ID: tlsNG-c201ff/1782913716-14B012B8-335149DC/0/0 X-purgate-type: clean X-purgate-size: 1672 On 01.07.2026 15:08, Jürgen Groß wrote: > On 01.07.26 13:39, Jan Beulich wrote: >> On 01.07.2026 13:16, Juergen Gross wrote: >>> Today the XEN_DOMCTL_setvcpuaffinity hypercall will not only change the >>> affinity settings of a vcpu, it will return the new effective settings, >>> too. >>> >>> In case an error happens during this hypercall, the expectation of the >>> caller is that the affinity of the vcpu didn't change. This isn't true, >>> however, if passing the new effective affinity back to the user is >>> failing. >> >> That'll be the caller's fault though. Any -EFAULT coming back are an >> indication that the caller needs fixing. >> >>> Instead of making error handling in the hypervisor even more complex, >>> just change the interface by NOT passing back the new affinity. It can >>> easily be obtained by another XEN_DOMCTL_getvcpuaffinity call if >>> needed. >> >> At the expense of further increasing the pressure on the domctl lock. >> When making the recent error code change in this area, I was actually >> wondering in how far these two sub-ops might also be candidates for >> moving out of the locked region. Yet with vcpu_affinity_domctl() not >> using any locking that didn't look entirely straightforward to answer. > > The calling hierarchy for the XEN_DOMCTL_setvcpuaffinity case is: > > vcpu_affinity_domctl() > vcpu_set_hard_affinity() > vcpu_set_affinity() > vcpu_set_affinity() > > vcpu_set_affinity() does the correct locking (takes the unit lock). But that's not sufficient: The two involved vcpu_set_affinity() calls want to stay together, i.e. not race with another domctl. Jan