[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN][PATCH] x86/hvm: vlapic: move vlapic_set_ppr/apicv_write() under CONFIG_INTEL_VMX


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • Date: Thu, 23 Oct 2025 18:15:56 +0200
  • Arc-authentication-results: i=1; bugseng.com; arc=none smtp.remote-ip=162.55.131.47
  • Arc-message-signature: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; c=relaxed/relaxed; t=1761236156; h=DKIM-Signature:MIME-Version:Date:From:To:Cc:Subject:In-Reply-To: References:Message-ID:X-Sender:Organization:Content-Type: Content-Transfer-Encoding; bh=UozdKfoZsjAi+/92oPIl9SJW0PZ3oD10egncKYftKFg=; b=OXPgxvijBUTqrpUiNibTzrHxJgzSdix7irsm1Ar6nkXhi5vHt5UoP9ut6GTiL/PvTI1H Bv/Fd0K6ve28lZ6B00RDHq674hlr7MbAsBFjE4PdQMkRQmNDaoZZONemZmktHa2ySnGuJ cxh7IZS+GcknBtEQwzQ9wTDKq1NXVZRFLSCIik0rjRt8tkcLvUj8UIOJL9O6XDA1AQe12 a+ttFhb+SMXInlVaLkHQoSO0ywXttFBowXiMTFdLPAZc/rHFir/lvryuiulgWxo0VuX6j BGpn7M+HdVgGpkT5r4FR+Tf/l7j+4FByjWx/Uv2ZWMtg+quxUVZS7YH+AJWCtJF8KdpCd lMNoCdNs37KujEPw+W7YbkkKXJZY2nZIC2EKrjtS3t9GglAJd32hD4USmosCRmCeBsKmB zdf+o6ZbC6CziYXhe9r+2X9LN7MJXf26jcXTj5ACKPs61AhkzBcYrasksl+jbH9Jiv4AJ yOFo7xp/pG7SpnZRulN4hZ3qmhywNhcV7qhucXL27EX6857MMwgAfFtATXuTISeuxeOYE 6rDprsG/UIgNUBY0r/l2MTS40aEP/S9a3DgiR2TpRGKGZtgpiQNdws25nKLOuKqs0moA5 8MZHVQCRYEc5I/SC1AjosFF0+LqBRQM8ZFqUJSdOZp1tuWcb4AaEzScGvNLzuMM=
  • Arc-seal: i=1; d=bugseng.com; s=openarc; a=rsa-sha256; cv=none; t=1761236156; b=ndS2bkNDFM1LpBtmINmlY3hE6f9mleleXmDX0AhUa4H5CVsW+IiL5DoOmrwR+dN/OZ49 HLtH2I1WRae4QGWSTvk2yNay00xtOPyve4OIAZJy6mmcm7pqdsJ8ry2tNLhZ5IktQDDPm N3vZyeMQ2eq+s7yDL/7UZdKa5I5NEWgGHBQsUS9bSt0gCBpVYf1hMPiKzyuGoxQq+i/+3 PFxE1IvRoHFvS80GB4cWE752jwiDiioo7Jwwm/sbSt4ImuzDjFeudsz28Kcb65ac4DExj jOfczaj6JKRLgwWqT5TQKgg4xQYYf4M7v5JCiJ8q7FMFsLMwKQRrxL2btQgzG24+0T94h NzgrHt8uffsISEuVCsEvwC7LTtuEOngym6KjJ7IsWPWesZwj6hYngdgGIsDXfNiURHI9Q kFQIprNxTe9P2iujbneu8UzYLmYfC/37TfM5ptHPSitlIwpPrFz6wD6JldiyHjxPc4E0r em8xaHcoltr/Jekheyf3AVb8NckpvbnKjDf+fMNqJO1XphUCEldC/3MsSBE/Tp7UtGGna Dex8eKyzCKx+GrWSOsB8ctTFokMsuBEKWakQYwPwpQsPS9wrkgia72dE9fKN7fb6k9llD ZfYvU8PCSnmR1SbfrKvSV4rd5TwtrKTGfhX9R3TbunwINCbIKGHiGdwjstblPto=
  • Authentication-results: bugseng.com; arc=none smtp.remote-ip=162.55.131.47
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 23 Oct 2025 16:16:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-10-23 17:37, Jan Beulich wrote:
On 23.10.2025 17:30, Andrew Cooper wrote:
On 23/10/2025 4:20 pm, Grygorii Strashko wrote:
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

Functions:
 - vlapic_apicv_write()
 - vlapic_set_ppr()
are used by Intel VMX code only, so move them under CONFIG_INTEL_VMX ifdef.

Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

Yes and no.  Yes right now, but this is needed for AMD AVIC, which I
understand is one one of the plans.

Throwing #ifdef's around like this in common files is fragile and will
lead to a randconfig nightmare.

There is an alternative which ought to work.  Turning on
-ffunction-sections (we already have this for livepatching), and
implementing link time --gc-sections (new work).

That way, the compiler/linker simply drops functions that are not
referenced in the final binary.

Personally I think it will be far nicer and more scalable than the
#ifdefary, (not to mention far easier - it gets rid of everything
unreferenced with one fell swoop).

Thoughts?

We'd need to have Misra buy-off on such an approach. I'm not sure if Eclair's
scanning would take --gc-sections effects into account.

Jan

Currently it doesn't, but we do have plans to implement something similar in the future. What might help in the meantime is using ECLAIR Code Scout to tag and hide unused program entities. Not sure if the mailing list is the best place to present the idea, but I'd be happy to illustrate it in a community call or something similar.

Basically the idea is that if something is possibly reachable it will be captured by Code Scout, and then a second analysis can use that input to selectively find and tag (e.g. "unused") the definitely unreachable entities. This could be limited to functions for instance, and then when the rule for unreachable code finds something unreachable, it can be silenced selectively for tagged functions, because we know that these are unreachable due to that reason. It's not 1:1 with the --gc-sections behaviour, but realistically it's much closer without resorting to #ifdefary all over the place.

--
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.