[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN][PATCH 3/5] x86: hvm: factor out compat code under ifdefs
- To: Jan Beulich <jbeulich@xxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
- From: Juergen Gross <jgross@xxxxxxxx>
- Date: Thu, 13 Nov 2025 15:46:36 +0100
- Authentication-results: smtp-out1.suse.de; dkim=pass header.d=suse.com header.s=susede1 header.b=f+lMhS5t
- Autocrypt: addr=jgross@xxxxxxxx; keydata= xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, Jason Andryuk <jason.andryuk@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Thu, 13 Nov 2025 14:46:46 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 13.11.25 15:39, Jürgen Groß wrote:
On 13.11.25 14:23, Jan Beulich wrote:
On 13.11.2025 14:18, Grygorii Strashko wrote:
On 13.11.25 14:30, Jan Beulich wrote:
On 11.11.2025 18:54, Grygorii Strashko wrote:
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -29,10 +29,12 @@ long hvm_memory_op(unsigned long cmd,
XEN_GUEST_HANDLE_PARAM(void) arg)
return -ENOSYS;
}
- if ( !vcpu_is_hcall_compat(current) )
- rc = do_memory_op(cmd, arg);
- else
+#ifdef CONFIG_COMPAT
+ if ( vcpu_is_hcall_compat(current) )
rc = compat_memory_op(cmd, arg);
+ else
+#endif
+ rc = do_memory_op(cmd, arg);
Why would this be needed when vcpu_is_hcall_compat() already honors
CONFIG_COMPAT?
(Same question then applies elsewhere, of course.)
This I do not like by myself, but I was not able to find other options :(
hypercall-defs.h is autogenerated and it's the only one place where functions
declarations like do_x_op() are appeared or disappeared.
So build is failing without ifdefs as compiler can't find compat_memory_op()
declaration.
Oh, I see; I hadn't thought of that aspect. I wonder if we wouldn't better take
care of that in the machinery there. Cc-ing Jürgen, who did introduce this
originally. Maybe he has concrete arguments against us doing so.
No arguments against it.
You probably will need a new Prefix defined (e.g. compat_always) and set it via
#define PREFIX_compat_always compat
unconditionally. Then it should be possible to have
Prefix: compat_always
memory_op(...)
outside of #ifdefs and drop the memory_op() in the #ifdef CONFIG_COMPAT section.
Oh, this might be wrong, as this will break the PV32 memory_op() hypercall.
You need to keep the current memory_op() in the #ifdef CONFIG_COMPAT section
and move the compat_always stuff into an #else part of the CONFIG_COMPAT.
This should result in the compat_memory_op() prototype to be always available.
Having no related function should be no problem due to DCO in case CONFIG_COMPAT
isn't defined.
Juergen
Attachment:
OpenPGP_0xB0DE9DD628BF132F.asc
Description: OpenPGP public key
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature
|