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 99889C636CC for ; Mon, 13 Feb 2023 19:25:26 +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=kChVRCQgtU2KqKPsbZRu8VKrS91ZQj1sRs1tHBd9yYA=; b=oRJKaQwyhasa2A rwYx7hE3HrZrU096C2TYyGU/N6dw75JsBsUXnWnuTYSP7v+aN6RZ2vro0fbCt9cHyeCLBD4mObOK2 e/HwH0WfdeZnJ3AJNXxk9Vjno3wwy3qJsXa/mxUyGpmrh+IUONdjHZj2VGBND5hpC7xXnKIaUAEdt JUc+hhC7h6uCd9rPAbEyU0AxRcvm4TYJfEiF0fP5kzUX5YEF/4rPODDN9DKVsFAEhW3N4B9cP2ocm XN5RbIcpNPh3xBgWpaYeliaPbO+y9mKO97PdpQAOpwtCKbaecb5y4esOV0Twy1pn4NS8KQHVeiVmx r1Qpmjt0BDzhBnTW+i+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pReR6-00G0OC-8Z; Mon, 13 Feb 2023 19:24:24 +0000 Received: from out-79.mta0.migadu.com ([91.218.175.79]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pReR0-00G0Kz-Mx for linux-arm-kernel@lists.infradead.org; Mon, 13 Feb 2023 19:24:22 +0000 Date: Mon, 13 Feb 2023 19:24:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1676316253; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=f8nzKSypT68KL9S7YC2rsMZzZ+ktVZK7yILGCTs6YAY=; b=DbdN8DhO/C1/6ITgFsNlm1m+xoLq3BFn2K189nDhWf3ZeZlJ6CxRKgaZ5TGSk8ZVC7XfXo Xpi7Ga6jCdOnTjIhwMNI+1qrJicA6eZw6rbPFs6yCQvClG4+jadPu1LavoTdlu/nsYppTZ QHAg4eVRVglvUMKvQvP+GSgyiZTEAA8= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Sean Christopherson 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: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230213_112419_231787_9B8B29AD X-CRM114-Status: GOOD ( 17.08 ) 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 Mon, Feb 13, 2023 at 04:01:29PM +0000, Sean Christopherson wrote: > 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. And surrender the opportunity to write a smartass commit message? I think not. > 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; > + }; You could pull further shenanigans with the x86 residue by guarding longmode with #ifndef __KERNEL__ and using a macro to raise the 'longmode' flag. Then we can all pretend it never existed :) -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel