[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/HVM: tidy _hvm_load_entry() for style
- To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Mon, 31 Jul 2023 14:44:48 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2V8uDiiJjUf8iU0IlQh22JLq6X9j3X/svHUk6kdvPDI=; b=LkBFG/aD49ho759DRgtCiDK5Dm4CIN2LnTVbsJwccymJwVzCKpIzClbvKQNiQFLOrR7Bbfz6NyG6gNzRfnFG3VeFuutLsYUj9viqCWXjwAIFD39J5uDAinT8VAGgYliYNBP47SUpxBu+whN9mz9B8tfwQCfF3HyNTJB4kW0/wIC2JO10EHF58g7RpoHN7z2mpmrAx6Wckg/rFG7ArwU5Le90bNYDWMzbxhtvkQvXe7Zoolz4LN+wQNtvCu75pc7l0YGOoAzWF0mbTm9W6HvAh8vd2XeOHfwVt9GlmXEPG95HU32kL9CxI/dpboyY2W3OA0WinW9JTCLTpABjLoQY3w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l5y7SvaBVxzrisDMsSN3HHkmB63BjWhFSDazRYoQAZIhnUWIq1hh5WKu7ZtV71oT27z/AGrGS+gigGm6/+gMt8Q4l+ICjKmmPUzJ4vBGtixwjdD/MtddiFO6UZHze/Q00RfsGVknLvyYULCEJuTDsogF+PtDIg4pu/cd7Dm/K03ONt4WpSOg0ASP7Nb/xZ2hFcaIuYL3r7/iEnOMNffyiT6+zelQSHg2WdO4u/pQXMcf4uE8BTnv1ZsNPqRbJL/yeIbXO7+kxjxSTxuEzIkJwJKNIOD1XFUFH/gf6NLfS5gWF2Rxwk9Z+IL46zUbGg01y/u4Q+u//ddM1iXhGJE/Wg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
- Delivery-date: Mon, 31 Jul 2023 13:45:40 +0000
- Ironport-data: A9a23:hfmt46BwmQjkqxVW/+jiw5YqxClBgxIJ4kV8jS/XYbTApDsl0jQOz msaWW2EO/yIYWH9eIslPNy18BhU6sTVztNlQQY4rX1jcSlH+JHPbTi7wuUcHAvJd5GeExg3h yk6QoOdRCzhZiaE/n9BCpC48T8nk/nOHuGmYAL9EngZbRd+Tys8gg5Ulec8g4p56fC0GArIs t7pyyHlEAbNNwVcbCRMsspvlDs15K6p4GxD5wRnDRx2lAS2e0c9Xcp3yZ6ZdxMUcqEMdsamS uDKyq2O/2+x13/B3fv8z94X2mVTKlLjFVDmZkh+AsBOsTAbzsAG6Y4pNeJ0VKtio27hc+ada jl6ncfYpQ8BZsUgkQmGOvVSO3kW0aZuoNcrLZUj2CA6IoKvn3bEmp1T4E8K0YIw5swmBzpc0 OcjFwsBbjvb2v+uxoihRbw57igjBJGD0II3nFhFlGicIdN4BJfJTuPN+MNS2yo2ioZWB/HCa sEFaD1pKhPdfxlIPVRRA5U79AuqriCnL3sE9xTI+uxuvDG7IA9ZidABNPL8fNCQSNoTtUGfv m/cpEzyAw0ANczZwj2Amp6prraWw32rAtxNTtVU8NZ1hnu2zWkuDCYJWGW8oNunlBSbf/9Qf hl8Fi0G6PJaGFaQZtv3UgC8oXWElgUBQNcWGOo/gCmdx6yR7wuHC2wsSj9adMdgpMIwXSYt1 FKCg5XuHzMHmKKRYWKQ8PGTtzzaES4UJmgGbGkaQBcf4t/iiIsugQnCSNklG6mw5uAZAhn1y jGO6SQ72bMaiJdS073hpA+exTWxupLOUwg5oB3NWX6o5R94Y4jjYJG07V/c7rBLK4PxokS9g UXoUvO2tIgmZaxhXgTUKAnRNNlFP8q4DQA=
- Ironport-hdrordr: A9a23:fFlSXKinTSXBkYxamkL6Lau0oXBQXtQji2hC6mlwRA09TyX4ra yTdZEgviMc5wx/ZJhNo7690cu7IU80hKQV3WB5B97LNmTbUQCTXeJfBOXZsljdMhy72ulB1b pxN4hSYeeAaWSSVPyKgjWFLw==
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 31/07/2023 2:31 pm, Jan Beulich wrote:
> The primary goal is to eliminate the Misra-non-compliance of "desc"
> shadowing at least the local variable in hvm_load(). Suffix both local
> variables with underscores, while also
> - dropping leading underscores from parameter names (applying this also
> to the two wrapper macros),
> - correcting indentation,
> - correcting brace placement,
> - dropping unnecessary parentheses around parameter uses when those are
> passed on as plain arguments.
>
> No functional change intended.
>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>
> --- a/xen/arch/x86/include/asm/hvm/save.h
> +++ b/xen/arch/x86/include/asm/hvm/save.h
> @@ -47,30 +47,32 @@ void _hvm_read_entry(struct hvm_domain_c
> * Unmarshalling: check, then copy. Evaluates to zero on success. This load
> * function requires the save entry to be the same size as the dest
> structure.
> */
> -#define _hvm_load_entry(_x, _h, _dst, _strict) ({ \
> - int r; \
> - struct hvm_save_descriptor *desc \
> - = (struct hvm_save_descriptor *)&(_h)->data[(_h)->cur]; \
> - if ( (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x), \
> - HVM_SAVE_LENGTH(_x), (_strict))) == 0 ) \
> +#define _hvm_load_entry(x, h, dst, strict) ({ \
> + int r_; \
> + struct hvm_save_descriptor *desc_ \
> + = (struct hvm_save_descriptor *)&(h)->data[(h)->cur]; \
> + if ( (r_ = _hvm_check_entry(h, HVM_SAVE_CODE(x), \
> + HVM_SAVE_LENGTH(x), strict)) == 0 ) \
> { \
> - _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH(_x)); \
> - if ( HVM_SAVE_HAS_COMPAT(_x) && \
> - desc->length != HVM_SAVE_LENGTH(_x) ) \
> - r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length); \
> + _hvm_read_entry(h, dst, HVM_SAVE_LENGTH(x)); \
> + if ( HVM_SAVE_HAS_COMPAT(x) && \
> + desc_->length != HVM_SAVE_LENGTH(x) ) \
> + r_ = HVM_SAVE_FIX_COMPAT(x, dst, desc_->length); \
> } \
> - else if (HVM_SAVE_HAS_COMPAT(_x) \
> - && (r = _hvm_check_entry((_h), HVM_SAVE_CODE(_x), \
> - HVM_SAVE_LENGTH_COMPAT(_x), (_strict))) == 0 ) { \
> - _hvm_read_entry((_h), (_dst), HVM_SAVE_LENGTH_COMPAT(_x)); \
> - r = HVM_SAVE_FIX_COMPAT(_x, (_dst), desc->length); \
> + else if (HVM_SAVE_HAS_COMPAT(x) \
> + && (r_ = _hvm_check_entry(h, HVM_SAVE_CODE(x), \
&& on prev line, and an extra space before HVM_SAVE_HAS_COMPAT()
With that, Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
This code re-enforces my firm belief that this has no business living in
the hypervisor at all. All of this can live in userspace, with a
slightly improved hypercall interface.
~Andrew
|