From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A094619006B for ; Thu, 16 Jan 2025 10:23:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737022984; cv=none; b=ACDgJdqKhjajZYY56libxC7Kj1CJlSvHLZtCyd7knanbPkICHnzaKPfgO0WdSXw2yfUM7kr+xYlk0tCkuzyA1p8AMnTQ6ZgOqqoQyszdgSm1MsgleoJ7+bhO1eZ3mj8Iou8PP86/suGAVBCOlM1rE92I/WGVxD/XO4QqcBkV1hg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737022984; c=relaxed/simple; bh=JG8h+uCoDb0V0P9xECJMNPDq9Qp3ydXL1LWFsz986So=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=nIqhLRcgPdrS5neNUjdsQKyAbkMRucz2LO+CR43u7is3AS5JM2Gw/tGl8MMHkPSwLkP6jftzSJceaRwtE4ZY64BLAMXYMrrVfsR3boLjsZEoonDe9SrKaoZiqHkqX5ZFmdT0vsITNE12o+qCy7zS0dG5hXAa6YGA0Eig/wAjYUI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=Fne0YYKF; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="Fne0YYKF" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-387897fae5dso36506f8f.2 for ; Thu, 16 Jan 2025 02:23:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1737022981; x=1737627781; darn=vger.kernel.org; h=in-reply-to:references:from:to:cc:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8ZkvdDnyLVGp1IEy4txVMz8RNqPNLFiF+bNPBLcxx30=; b=Fne0YYKFOngp/HLE9WUkyUeG/1h7jgarGs2eEixLkBi1daxrIOscRFAsvrRnhH0ool pKEm0Bd5nd68kqGC3n1VFTU41PV/zuCsZaueEM8BOcGSiuHsuhrdbFHqQGy0xQpEqd5u /zpbooKe3tapqFCmlW5qgPv/v6XC504IttdRJCN6BCFeL12YgR4xmVMs061CoJtLUUVp cesc53RX8C0xwhHCITnhy+VUpLLAlHGhe+AyJ43kIbM6OVIKtZtEfJnkVCILPOoIqqYS X46zYoNmE0DVVXBXSm5jgK65tWKktqkOlsTTnpZGAayYE3YP3esAqMBYuy+a5lrJOlbP kbkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737022981; x=1737627781; h=in-reply-to:references:from:to:cc:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=8ZkvdDnyLVGp1IEy4txVMz8RNqPNLFiF+bNPBLcxx30=; b=ZyXcGF0nHspfgObKBhHw8xCR4gXUJ2F+5H5ZZmXkVqgBc/oSJtx6kQ7zRjylciSM4D Goczu+44b4HvN1rITBRKLhmGZTzzxRN48YmUF5YVunxyWGU+z9UZqkGbPoBOyU77VLDE vmGG9hQipUA1+XN5F5vphjl20L0OH19xkbn0p8VSD29caZERYQRVVBNMFf9/C9GAqvVk ZmOo/p6+yEFOQtlWqN2ZVE8ThncmYkDU2Huu/uCMgUlFNihMU5LlEKAc/qgxDdUXCfzS UxPYGxtmYdZ3Tugr3wOlRiY7AkCAT7ZvEiN2Zg7m1BXBNmB3BpSMHaj3xtjK1W+m523t oQTQ== X-Forwarded-Encrypted: i=1; AJvYcCWRwB7RyfCVpLBh/FNUT71ZaLXQ3dizV8x16CDigDJUYosvq+tLXZ+D8qtOAITdxtHfFOC04wBXEjAyD1w=@vger.kernel.org X-Gm-Message-State: AOJu0YyJnzOSMqWf+ufwD2Y4ET9dDuYvqbZcogjtnflYIt8ObUWpdBY6 gwZj5Lnz3IwWQWzaqS2TKs9jmajkPy4RVjzyc8taQBJ2s5+zvaQqG26Ng6ixVIg= X-Gm-Gg: ASbGnctvbEqEpqjx7+kpu7TsomOhl/hv32pETd9V+kyCS2TqIH9an7u8DS0Bip06aPC vOwJYwajT3YiVQyOBkICDb1eT2+8WwUU/L2Ij3B6N8Ud/nWDlNHO/nwY2spr/tMb5uTM6S7nlge IVDzA7fVUBzlySVjZqmHCzvBXdlbc3TL1ovgK5iYZrhaZVQf+xkoL0WPH5ynYhv26l6lLy4bA3Y PuZoK66WDiJw9KzYPGl0Tqmj1Bz6CBDKA6jkD4s3fCeiEbo4tJXaq+ZcY7HPDwJud2Bp9XNIAQb Wm2rhnYqa51ZMsAK X-Google-Smtp-Source: AGHT+IGRoCDvefbFzC6jI8eoiyaJwQY+MVagscMSk1SQP59pQNBBzH+/Z2VgQqY5H4m/ta4tZ/nIKw== X-Received: by 2002:a5d:5848:0:b0:385:f7a3:fec1 with SMTP id ffacd0b85a97d-38a872dc81dmr10932658f8f.3.1737022980865; Thu, 16 Jan 2025 02:23:00 -0800 (PST) Received: from localhost (ip-89-103-73-235.bb.vodafone.cz. [89.103.73.235]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c74ac207sm54165545e9.12.2025.01.16.02.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2025 02:23:00 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 16 Jan 2025 11:22:59 +0100 Message-Id: Subject: Re: [PATCH] riscv: Add initial Xen guest support for RISC-V Cc: , , , , , , , , , , , , , , "linux-riscv" To: "Andrew Jones" , =?utf-8?q?Milan_=C4=90oki=C4=87?= From: =?utf-8?q?Radim_Kr=C4=8Dm=C3=A1=C5=99?= References: <20250114-316084c962eb867c0b681043@orel> <20250116-aa9eadde9279e66dbc01c705@orel> In-Reply-To: <20250116-aa9eadde9279e66dbc01c705@orel> 2025-01-16T09:51:25+01:00, Andrew Jones : > On Wed, Jan 15, 2025 at 08:04:05PM +0100, Milan =C4=90oki=C4=87 wrote: >> On Tue, Jan 14, 2025 at 7:18=E2=80=AFPM Andrew Jones wrote: >> > On Tue, Jan 14, 2025 at 05:09:36PM +0100, Milan Djokic wrote: >> > > +#define SBI_ECALL 0xE >> > >> > Shouldn't this be 0xA000007, i.e. the SBI firmware specific extension >> > for Xen. Otherwise why refer to SBI? Note, '0xE' is an invalid, legacy >> > extension ID in SBI. >> > >> Hypercall is triggered through SBI and we defined 0xE just as an >> SBI_ECALL ID on Xen side for hypercall handling (among other operation >> IDs), so we're not referring to some standard /legacy ID here, just >> utilizing SBI for hypercall handling. > > If the SBI specified EIDs and binary encoding aren't used, then the > hypercalls aren't "triggered through SBI", Xen is just doing its own > thing on an ecall. Xen doesn't have to implement SBI at all, but if > it wants to provide SBI services, as well as its own hypercalls, then > the hypercalls should be encoded in the same way as SBI functions and > an EID allowed by the SBI specification for hypervisor-specific > functions should be used. For Xen, that EID is already specified and > it's 0xA000007. SBI specifies a complete calling convention, but it's not necessary for binary compatibility. SBI also aims to simplify caller API. Linux maintainers will want a good reason for introducing separate Xen SBI call functions/macros (linux already has sbi_ecall, so please try to use and potentially improve it), but the ECALL is guaranteed to be SBI compatible as long as a7=3D0xA000007. a7 is needed to denote Xen's extension space and the remaining input/output registers can be implemented in any way Xen wants.