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

Re: [PATCH v3 04/14] xen/riscv: add <asm/csr.h> header


  • To: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 7 Feb 2023 15:55:25 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=aLwNBKHAemjJEccoETxEMrCE1WQwSTUOFcIQGZqFZVw=; b=L0o+56rt8sLR4DzmELXaw8DvVNanzwa5K3CIpdO/6Zn9RBvo76XLGp94/+cU/i4tSJtcTkoOmppAKVVcBF3VBpvLHyoZjT9f3K22KMXhCeVCJsV/s6O4LlTgC7eWICz1ED1dsSGntX6utWnUe6AtOu4mxYYEIWqg9FvERo1zLgAz0lKsqG2/2BQ301lkhaUadnaBnwp2PxVIrVaE1PRhTWi/EC1XIJDsp+i4QLwIratPVUagGbNKsH76srKVZwIIcH7hyMQMGf3H0IafyFTTtE1NC+ntPU3QHxOHZh+bilWxr1tK2cIhTlmlfBo1LdiR3La4TDqleDjMR0cyEtoiuA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n5PyTZJ5u6sWzQm7LQzz4RLt3JWzEh9n1sj8ftYVNeyjt/Wahuyth6ifVqzIMUGzHlEcdb8lWhnCA0N41m1GiNO7RgCjuIQE3GdoAAR1Hp6TV7pIaVs7NxkVSgp8i+jsvSNRuf+MACbIq4OnMf+EE7c/8MycyPav3D6u8HQQ5hy7wsi+g3QSJICi/bFHneZ9czH4/E4kRgiSrsBvZjUW+ImTkxBMHy7XTyS+cYMNj//WuXHn4k8/JI9miQzKmPdBYITCmgpQwMH9BOZJvOZ0g9a0HoAywL64VPJEI3JEtijMHrKCQ4svu6XYZRaaVe2TuzihDXoI8QJebrZEAJ2bCg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Julien Grall <julien@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Gianluca Guida <gianluca@xxxxxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 07 Feb 2023 14:55:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.02.2023 15:46, Oleksii Kurochko wrote:
> --- /dev/null
> +++ b/xen/arch/riscv/include/asm/csr.h
> @@ -0,0 +1,84 @@
> +/*
> + * SPDX-License-Identifier: GPL-2.0-only
> + *
> + * Copyright (C) 2015 Regents of the University of California
> + */
> +
> +#ifndef _ASM_RISCV_CSR_H
> +#define _ASM_RISCV_CSR_H
> +
> +#include <asm/asm.h>
> +#include <xen/const.h>
> +#include <asm/riscv_encoding.h>
> +
> +#ifndef __ASSEMBLY__
> +
> +#define csr_read(csr)                                           \
> +({                                                              \
> +    register unsigned long __v;                                 \
> +    __asm__ __volatile__ (  "csrr %0, " __ASM_STR(csr)          \

Nit: There's now one too many space (here and elsewhere below) between
the opening parenthesis and the opening double quote.

> +#define csr_clear(csr, val)                                     \
> +({                                                              \
> +    unsigned long __v = (unsigned long)(val);                   \
> +    __asm__ __volatile__ (  "csrc " __ASM_STR(csr) ", %0"       \
> +                            : /*no outputs */                   \

Nit: Missing blank inside comment.

I think these adjustments could be done while committing, assuming no
other changes are necessary and an ack appears.

Jan



 


Rackspace

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