public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>, kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, scgl@linux.ibm.com,
	borntraeger@de.ibm.com, pmorel@linux.ibm.com,
	pasic@linux.ibm.com, nrb@linux.ibm.com, thuth@redhat.com,
	david@redhat.com
Subject: Re: [kvm-unit-tests PATCH v1 4/4] lib: s390x: stidp wrapper and move get_machine_id
Date: Thu, 31 Mar 2022 17:24:26 +0200	[thread overview]
Message-ID: <3026196e-7a6f-307b-cf83-cd362ef804f1@linux.ibm.com> (raw)
In-Reply-To: <20220330144339.261419-5-imbrenda@linux.ibm.com>

On 3/30/22 16:43, Claudio Imbrenda wrote:
> Refactor get_machine_id in arch_def.h into a simple wrapper around
> stidp, add back get_machine_id in hardware.h using the stidp wrapper.
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>

Reviewed-by: Janosch Frank <frankja@linux.ibm.com>

> ---
>   lib/s390x/asm/arch_def.h | 4 +---
>   lib/s390x/hardware.h     | 5 +++++
>   2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h
> index 8d860ccf..bab3c374 100644
> --- a/lib/s390x/asm/arch_def.h
> +++ b/lib/s390x/asm/arch_def.h
> @@ -219,13 +219,11 @@ static inline unsigned short stap(void)
>   	return cpu_address;
>   }
>   
> -static inline uint16_t get_machine_id(void)
> +static inline uint64_t stidp(void)
>   {
>   	uint64_t cpuid;
>   
>   	asm volatile("stidp %0" : "=Q" (cpuid));
> -	cpuid = cpuid >> 16;
> -	cpuid &= 0xffff;
>   
>   	return cpuid;
>   }
> diff --git a/lib/s390x/hardware.h b/lib/s390x/hardware.h
> index fb6565ad..8783ae9c 100644
> --- a/lib/s390x/hardware.h
> +++ b/lib/s390x/hardware.h
> @@ -43,6 +43,11 @@ enum s390_host {
>   
>   enum s390_host detect_host(void);
>   
> +static inline uint16_t get_machine_id(void)
> +{
> +	return stidp() >> 16;
> +}
> +
>   static inline bool host_is_tcg(void)
>   {
>   	return detect_host() == HOST_IS_TCG;


      reply	other threads:[~2022-03-31 15:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30 14:43 [kvm-unit-tests PATCH v1 0/4] lib: s390x: Refactor and rename vm.[ch] Claudio Imbrenda
2022-03-30 14:43 ` [kvm-unit-tests PATCH v1 1/4] s390x: remove spurious includes Claudio Imbrenda
2022-03-31 15:04   ` Janosch Frank
2022-03-30 14:43 ` [kvm-unit-tests PATCH v1 2/4] lib: s390: rename and refactor vm.[ch] Claudio Imbrenda
2022-03-31 15:15   ` Janosch Frank
2022-03-30 14:43 ` [kvm-unit-tests PATCH v1 3/4] lib: s390x: functions for machine models Claudio Imbrenda
2022-03-31 15:21   ` Janosch Frank
2022-03-30 14:43 ` [kvm-unit-tests PATCH v1 4/4] lib: s390x: stidp wrapper and move get_machine_id Claudio Imbrenda
2022-03-31 15:24   ` Janosch Frank [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3026196e-7a6f-307b-cf83-cd362ef804f1@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=pmorel@linux.ibm.com \
    --cc=scgl@linux.ibm.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox