From patchwork Thu Feb 16 17:12:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Imbrenda X-Patchwork-Id: 13143535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE55DC6379F for ; Thu, 16 Feb 2023 17:13:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229797AbjBPRNJ (ORCPT ); Thu, 16 Feb 2023 12:13:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjBPRNG (ORCPT ); Thu, 16 Feb 2023 12:13:06 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B8243346A for ; Thu, 16 Feb 2023 09:13:02 -0800 (PST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31GGMgJJ015010 for ; Thu, 16 Feb 2023 17:13:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : mime-version; s=pp1; bh=ThE+300bTPfKcmB+pP5LjwjG/c5CnpJoo0ZOjQKtNxQ=; b=BhcuzRl+qOjUV0kuKkoS5w7RsJL4nB8z6tUhXsB6mVh21GCLPbTSLOVj2ltbH2w8vnkq 9OQ6ogGExupevLZlcn8VG+w1bFK+bc9+c9phln4sSSF34n/XZedKww4EDmfiGSbicheo A9rDzMZU3UkTZwt8t00qf5o1kJf9OOmFjAiewQcJT8UbYdeix2MftZcOMWaqE+ObGDnf VXnkY2MKAyjayjrade4CLdp2G88RxyVD/O91xLB6rYVF373Nmog61F54FqJMOLckjrMw yr/6uKqlH9ILXJCRYk1LUp/85zOSNKY36XhJ/3b/TYYv8w4N3ZVGobeJLjqlFEecwdIm Lg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nsqy3h7ew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 16 Feb 2023 17:13:01 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 31GGxeBN003257 for ; Thu, 16 Feb 2023 17:13:00 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nsqy3h7e0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Feb 2023 17:13:00 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31GFYara021570; Thu, 16 Feb 2023 17:12:58 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma02fra.de.ibm.com (PPS) with ESMTPS id 3np2n6n4wd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 16 Feb 2023 17:12:58 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31GHCuDR47186422 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Feb 2023 17:12:56 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 25CBC2004B; Thu, 16 Feb 2023 17:12:56 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EF8062005A; Thu, 16 Feb 2023 17:12:55 +0000 (GMT) Received: from p-imbrenda.boeblingen.de.ibm.com (unknown [9.152.224.56]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 16 Feb 2023 17:12:55 +0000 (GMT) From: Claudio Imbrenda To: pbonzini@redhat.com, thuth@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com Subject: [kvm-unit-tests GIT PULL 01/10] lib: s390x: add PSW and PSW_WITH_CUR_MASK macros Date: Thu, 16 Feb 2023 18:12:46 +0100 Message-Id: <20230216171255.48799-2-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230216171255.48799-1-imbrenda@linux.ibm.com> References: <20230216171255.48799-1-imbrenda@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 6aJo4LIF-fa53a85q37EnPCNv6wuHtIV X-Proofpoint-GUID: 831cpLj-RJDlSxGPHvA46NBITApG3eTb X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-16_13,2023-02-16_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 suspectscore=0 mlxlogscore=994 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302160148 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Since a lot of code starts new CPUs using the current PSW mask, add two macros to streamline the creation of generic PSWs and PSWs with the current program mask. Reviewed-by: Nico Boehr Reviewed-by: Janis Schoetterl-Glausch Reviewed-by: Janosch Frank Link: https://lore.kernel.org/r/20221130154038.70492-2-imbrenda@linux.ibm.com Signed-off-by: Claudio Imbrenda Message-Id: <20221130154038.70492-2-imbrenda@linux.ibm.com> --- lib/s390x/asm/arch_def.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h index 783a7eaa..bb26e008 100644 --- a/lib/s390x/asm/arch_def.h +++ b/lib/s390x/asm/arch_def.h @@ -41,6 +41,8 @@ struct psw { uint64_t addr; }; +#define PSW(m, a) ((struct psw){ .mask = (m), .addr = (uint64_t)(a) }) + struct short_psw { uint32_t mask; uint32_t addr; @@ -321,6 +323,8 @@ static inline uint64_t extract_psw_mask(void) return (uint64_t) mask_upper << 32 | mask_lower; } +#define PSW_WITH_CUR_MASK(addr) PSW(extract_psw_mask(), (addr)) + static inline void load_psw_mask(uint64_t mask) { struct psw psw = {