From nobody Mon Sep 16 18:49:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1707147687; cv=none; d=zohomail.com; s=zohoarc; b=AraltJr7I3SJTWfS0b+3QCdkw2OKgfHiQTYN+cy0yJ9stN3p9M6uP9bfBZu9Cj2vv9/uHSwfxmsawFQ42b2qjLYD95V0lserby10hEfD4b30EtX2UptBnuQqZfVR2KDTj+XsFX0d/3ua2ATRkruO7Jvyp+v2t4GF6bE3MhzW6V8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707147687; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1EpDP5Niihr1G1U8oddvxlYPXrLXztpUK4y9JjJucU0=; b=i+CNNj6Zc++obq8XqOv8ZPzzZx73sRxEHyyK9IYGGffrhXfAWiMoOpDxa/K3q3WmQ20v//MKV+2gUvL62l19IIUcqvJv2nA2+5Phn4EIbIA2/llpWaWN8McA074FEBEFWf1QX3Vgt5pAIooJ456LJWpWQnedge36ayf7d/oazhw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1707147687422886.1414057253734; Mon, 5 Feb 2024 07:41:27 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.676289.1052419 (Exim 4.92) (envelope-from ) id 1rX15s-0006lH-3B; Mon, 05 Feb 2024 15:41:12 +0000 Received: by outflank-mailman (output) from mailman id 676289.1052419; Mon, 05 Feb 2024 15:41:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rX15r-0006lA-VW; Mon, 05 Feb 2024 15:41:11 +0000 Received: by outflank-mailman (input) for mailman id 676289; Mon, 05 Feb 2024 15:41:10 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rX0y2-0007I6-S0 for xen-devel@lists.xenproject.org; Mon, 05 Feb 2024 15:33:06 +0000 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [2a00:1450:4864:20::12b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id db09ce0c-c43b-11ee-98f5-efadbce2ee36; Mon, 05 Feb 2024 16:33:05 +0100 (CET) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-51032058f17so5125718e87.3 for ; Mon, 05 Feb 2024 07:33:05 -0800 (PST) Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id s1-20020a056512314100b005114d401157sm474445lfi.2.2024.02.05.07.33.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 07:33:04 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: db09ce0c-c43b-11ee-98f5-efadbce2ee36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707147184; x=1707751984; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1EpDP5Niihr1G1U8oddvxlYPXrLXztpUK4y9JjJucU0=; b=AN8Ihp99dtBw5I6JNYW9tD1VeVnWJhpSqUdhQusmlUkYQMXzRPizWRsdOzVWCfkFPY sVbR7kkOYc4KcDoH4o4EPF9HwLIansoShymgj5nZvpG1zVApQnWj4khyH7dUbmSYwjPb j4VYEfPTezmLtKBNC1HJluyUoE/507+riVMUNSwwaoEmE4uBE77gJ+RkNfwTclTBTGXf GRcRKVezLDBxVuImBadl25HCJFckJuMnOw+vsmlKMEFnpJL/onR56IQ+gfTeesONC+zK VEkB4Q0FAgviuLuqwmCO+Wd6sYISoE+kZWxpH6MoG629KV4n/j9EoAqo74faaEzfz9+a oBBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707147184; x=1707751984; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1EpDP5Niihr1G1U8oddvxlYPXrLXztpUK4y9JjJucU0=; b=A37pG9JcXNa8pSVWzHx0l+L7GmtvgAqYbhTC4RMH1vdIRNipyOooslq+uSAe261spc mJKQ1W4xGOKczMJlOqBdB3px9xuFfMJN5uzYZCXIp/mHgpAmGwQVwdF52dX5SL11Hojq /pTyktBn8KUmo1jJbQ2rQuNJhl46mVvidWIqakSMkUZeZ8ynMdIXpzJh/8uaLPltI2oS LzvS6HVTQfsLrnN3ZNXmxEPhGp0TOarv20V8vLmTKVetP6ESuzF4dd3v4ELBwCiN/zfP 2/Lccjx160WAAFbk99H0QY1t2zWzr+DGI1VfG/BxOp6J+l1TiKqymz2yZiPWsp4RUBOu bVRQ== X-Gm-Message-State: AOJu0YwzOP4X9DWWEKXAM8//wJvdlMvsWqOXN6i6ix8Rkes1+BDPxd4p 4mdlbVb8RsllOqElZbA+IvZxDz+VDA80ijFvBWkhH5HJdtuRZMUHQ27EP3sf X-Google-Smtp-Source: AGHT+IERUkJXhuMp6A3TCMQGfl0J9cJVgHeyC6Y/rwpGu/DjlIBSpgILDv+ywuxhQjJOp3Cp0Ta7HA== X-Received: by 2002:ac2:4851:0:b0:511:530c:d0eb with SMTP id 17-20020ac24851000000b00511530cd0ebmr1483769lfy.46.1707147184598; Mon, 05 Feb 2024 07:33:04 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCWKXyZj/KBMIs89OsXKMtwVDES+1i99zwaSRsx7gSuulzLmPt4qUpMFIoHLFRwPQ98NF+gS/TW5nF67SeRbE1DrwZLh+Pw2XEpWG91ddhub8ZOaf76QcvtzX6Urd7N7015H1+DPLqzCByJmuugNYz5/RUgcRB/zZF2Hcg1/FPzBizWrBn6+imbYIYR/lQ7mo/OWB+LUT8cUAscQBJbC9MMpBS9zMG4be2AqIF057WKoq8R+Tg3ofXQlyzDrsIJxbxtUP4qOl46izRKjw2r/U4LsFXxjSNumXYjZtJQUsmupi6+yqBC2e8WFH2RIrNXPty4qM3Ay From: Oleksii Kurochko To: xen-devel@lists.xenproject.org Cc: Oleksii Kurochko , Alistair Francis , Bob Eshleman , Connor Davis , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v4 23/30] xen/riscv: add required things to current.h Date: Mon, 5 Feb 2024 16:32:30 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1707147689776100001 Content-Type: text/plain; charset="utf-8" Add minimal requied things to be able to build full Xen. Signed-off-by: Oleksii Kurochko Acked-by: Jan Beulich --- Changes in V4: - BUG() was changed to BUG_ON("unimplemented"); - Change "xen/bug.h" to "xen/lib.h" as BUG_ON is defined in xen/lib.h. - Add Acked-by: Jan Beulich --- Changes in V3: - add SPDX - drop a forward declaration of struct vcpu; - update guest_cpu_user_regs() macros - replace get_processor_id with smp_processor_id - update the commit message - code style fixes --- Changes in V2: - Nothing changed. Only rebase. --- xen/arch/riscv/include/asm/current.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/xen/arch/riscv/include/asm/current.h b/xen/arch/riscv/include/= asm/current.h index d84f15dc50..aedb6dc732 100644 --- a/xen/arch/riscv/include/asm/current.h +++ b/xen/arch/riscv/include/asm/current.h @@ -3,6 +3,21 @@ #ifndef __ASM_CURRENT_H #define __ASM_CURRENT_H =20 +#include +#include +#include + +#ifndef __ASSEMBLY__ + +/* Which VCPU is "current" on this PCPU. */ +DECLARE_PER_CPU(struct vcpu *, curr_vcpu); + +#define current this_cpu(curr_vcpu) +#define set_current(vcpu) do { current =3D (vcpu); } while (0) +#define get_cpu_current(cpu) per_cpu(curr_vcpu, cpu) + +#define guest_cpu_user_regs() ({ BUG_ON("unimplemented"); NULL; }) + #define switch_stack_and_jump(stack, fn) do { \ asm volatile ( \ "mv sp, %0\n" \ @@ -10,4 +25,8 @@ unreachable(); \ } while ( false ) =20 +#define get_per_cpu_offset() __per_cpu_offset[smp_processor_id()] + +#endif /* __ASSEMBLY__ */ + #endif /* __ASM_CURRENT_H */ --=20 2.43.0