From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44A03C636D4 for ; Mon, 13 Feb 2023 16:02:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DUhLTb7uTQv4qZmBDeaVNBBcX3f9mXgMsUXfKpjLffY=; b=Rouo/DuXo1c44F L4XYEn2MBFV7NXGF1+zvWZWvAR3hgYGzS0/wQDwWu9n3GJMlCPnxET+7l0piG1CZWTjMLOV8A7x0r umb0UJj427pBsdFbEoUOgtK6FBGYjiglkrrjEQ1ElyP7OeWI4vcl5JdUgXQCD1r0t5w2v0BVd6UYB +W63BYEeYEeIzRQHO5GQ8LIAXgSS0gXt4ZM8YB9emgjwaQMdtqK6mQU+Ug27cKmd7GtI/OmryD3Vg m1gHzKMIaEG2UPHhxeLkM6XInh+hDqW6uQTq2cutPD6WxyWeEDkdjlaALfKB6fD/UHyIYLnQVPKtp /Zgf5SGrj5Wm56m0WPQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRbGr-00FMwt-TA; Mon, 13 Feb 2023 16:01:38 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRbGo-00FMva-Vw for linux-arm-kernel@lists.infradead.org; Mon, 13 Feb 2023 16:01:36 +0000 Received: by mail-pj1-x1031.google.com with SMTP id bt4-20020a17090af00400b002341621377cso1556774pjb.2 for ; Mon, 13 Feb 2023 08:01:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=HfKMheuMnk2N2hnnABuf2/07WBxZ/fjWOaNC2gda/eQ=; b=mNDXaatgSfc8naau84uWhzZcsql/fhj3yH/4/0kDcOgwGklnFmSAmam+weDVjFDPnu o/dNPkJRxgPzStSSXOzCPlKQHOT0rb1Ih5t3qQ/IavNTDo1OoNRMiinqeh7Ee4fn3eXb EoNI1vgOk2Dq2bsBgMzYsRToCf3fb5a+jV+BZv5civX3pinCfmB7QXggCoOlEnVepa37 9oQSMyT9VLDj8RcT+FzXG9eLNmroee+DVezSCupMGXJcWs35TLeIe1KX0EYjb5OlR2k9 6xtMpiYoCALs3pjnk5Ls4CzSACzmeO19HHhb1KXsD506/MCMr3O7Boopf2Oi6JyTL0Oe httg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HfKMheuMnk2N2hnnABuf2/07WBxZ/fjWOaNC2gda/eQ=; b=ZVJd258tE3uvg0tp2uW+NFCi6qP4S4OQN+Hsp9XkTv07La6bTb7oggqR5uZPXD9sF/ dYcykAemYkeA45EJkPrjNgtu32Tu0cS7AxJe4i8IRLZTbhSCPxPHlnJgNuc5ybWn83ou NqUOgVJKkEV7FHMviKzFx5ncq1K+7rYnA8xTdjNNv9IMzEo3JDh52rUfL1hp5Zdfck5J GzY8/Z4WbZKqaDd51qyWOwumEmZfyC5gtaV0DvAVKa+mAdP0Iw/jyonNc1zepHbhV34J CawnEYFgXN1hyeGCemDSVKGge5H1E4JBGpgUUlSMs1gH50VJpFv+PVuWZBcph0b5y+lk YsZw== X-Gm-Message-State: AO0yUKWXvbfVOquVWrBNsB+KxQMKwYcVS4E7TpjDflu7/3OVXxxJ07Z/ UUoJ9IhCUvqKOkwzKkRSZTyTwA== X-Google-Smtp-Source: AK7set91zlp5gLivK7fJ76YzrLhyC6/M7PZRmP+Ohh69tUMrhNnlq5foVfkJZNHiszA+axklomXnGQ== X-Received: by 2002:a17:903:3113:b0:198:af50:e4de with SMTP id w19-20020a170903311300b00198af50e4demr496739plc.4.1676304094069; Mon, 13 Feb 2023 08:01:34 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id e23-20020a62ee17000000b00594235980e4sm8162073pfi.181.2023.02.13.08.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Feb 2023 08:01:33 -0800 (PST) Date: Mon, 13 Feb 2023 16:01:29 +0000 From: Sean Christopherson To: Oliver Upton Cc: Marc Zyngier , James Morse , Suzuki K Poulose , kvmarm@lists.linux.dev, Akihiko Odaki , Zenghui Yu , Raghavendra Rao Ananta , linux-arm-kernel@lists.infradead.org, Salil Mehta Subject: Re: [RFC PATCH v2 5/6] KVM: arm64: Add support for KVM_EXIT_HYPERCALL Message-ID: References: <20230211013759.3556016-1-oliver.upton@linux.dev> <20230211013759.3556016-6-oliver.upton@linux.dev> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230211013759.3556016-6-oliver.upton@linux.dev> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230213_080135_050404_8ECEBC93 X-CRM114-Status: GOOD ( 14.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Feb 11, 2023, Oliver Upton wrote: > Finally, we need a flag to let userspace know what conduit instruction > was used (i.e. SMC vs. HVC). Redefine the remaining padding in > kvm_run::hypercall to accomplish this. Let's all take a moment > to admire the flowers and see how 'longmode' tied up a full u32 in the > UAPI. Weep. I don't think it has to, at least not for other architectures. No other arch currently supports KVM_EXIT_HYPERCALL, so breakage is extremely unlikely. E.g. we can likely get away with this, and then just have x86 add new flags at bit 32. diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 55155e262646..7d3ad820d55c 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -341,8 +341,14 @@ struct kvm_run { __u64 nr; __u64 args[6]; __u64 ret; - __u32 longmode; - __u32 pad; + union { + /* + * Long Mode, a.k.a. 64-bit mode, takes up the + * first 32 flags on x86 (historical sludge). + */ + __u32 longmode; + __u64 flags; + }; } hypercall; /* KVM_EXIT_TPR_ACCESS */ struct { _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel