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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 3A7B6CA0EC4 for ; Tue, 12 Aug 2025 22:38:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ulxcT-0005fh-FX; Tue, 12 Aug 2025 18:37:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ulxcR-0005fX-QI for grub-devel@gnu.org; Tue, 12 Aug 2025 18:37:23 -0400 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ulxcJ-00006i-Un for grub-devel@gnu.org; Tue, 12 Aug 2025 18:37:23 -0400 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-3e53743ad23so1570825ab.3 for ; Tue, 12 Aug 2025 15:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755038229; x=1755643029; darn=gnu.org; h=mime-version:references:in-reply-to:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=GoTEsa2CfZtx9YTHmIEx0LmiUzgSTJjgy7JsOjrh6TQ=; b=eEClpkZR40TC8gmUOWra+hEs/jRF8d26WnWGDFaNqkkJWFQ5t3hRtizQrsfmFvuj49 fKXI0KK2JHBo/zSSPYVEfpBYF7bfboHhfL3FSMv6ixUzdMJcTO1x1+2n0B7pyiSazvHs kgips5ifGzyvQ/vL+46wW0uN4qFxMHsFifcYSQXHfKrVayO2/xkqXOEPHBDbeOd+nzBw UL4CTsKKEythZ7bs6Ga5QIaMPA+Ajwk7InNcEG6SklL68/8Zc5j809v1BgVCDMSUWuri THaBwy22R/c1KwXiJ26OEd7giUzAhnQDy9SqH/lKbuZt3NJoOzWU3DP2Xg44ZaCDl9aY Mx8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755038229; x=1755643029; h=mime-version:references:in-reply-to:message-id:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GoTEsa2CfZtx9YTHmIEx0LmiUzgSTJjgy7JsOjrh6TQ=; b=vV95LcJKLFa9zdlpVr/Y82OZ9Cs1epFWh0dEoOZeYBUJPH6ETSlReXarfUKNkwFU2t twqKuB0qmhbH99QYmyoaeK655f3Ukxt1YUSaQ4tF9RL1CapcILIGsrLb2CFIjnV3PPtn xxSEm/3EOcIMEnkjJ+wzRjTeCKltq+UYWTVQcBAkDiW+7RyGioHMMTaViGek2j5XpR7z //xh9dXkHVwAbrRvfaj5xZ0cJhr/dcIL4lsaI1pBUhlpbfFkPGdFHh/4fakd8fu5gkkL amws2W8rvoCC3x4QKjl9Xc39stW9trl2KpCshyUNjzsVCR+sTsRB1p2j57OLiRsD9D1g z7IA== X-Gm-Message-State: AOJu0Yy4jaySfHXjwCtEzKZqKoi9U8euqwwzOXLlUK8Ep1S2sI2aiH4Z oVsTOpCcclDPdEoz+5P5y0CLXUlp0iHXukYS/gwHlF3JVmEFfZ/OSN6N X-Gm-Gg: ASbGncuV8lFLQx2vNzvyayGjN7Bv24vJMZxRBS8H/jUKeRSW9F/kQEVYsRaBvfJfiRv iEg4m5q7ToUcnft92slDNoOBiatr7YUkGJhqP7rIviBnJrVgMifnhm7OxiZA8J+BjCL4haeLbtj Tehxaq2i+V1YpJWES1VKnxI4qNQItHdOtTx6gnNaDg+R73DqMj5taJd65i712mP9HWvu18LV3wJ Z+VN5sfvxi7gErwtahANIFv3C6YtGumwIR0t20sB5GemiAGbaFFeRguehTh9qthTE0bfHKKZUkw OOCj7lonmGIXTzGOQI0caiw0Q5yZ/1vBxoVny/+iv6ADi2J5ZoOB/CYJdZD7aJxOLSO09KkbGdF bA+e05rsk4G6hm+OPxh6pczkcLmtGLg== X-Google-Smtp-Source: AGHT+IEbdi9eoBk5GmUZKZL3L8Z2NzSZ4S8CGJ5fmYB9WsXRHGzbQBjNlY4m8emcRYLncoBvMed96Q== X-Received: by 2002:a05:6e02:18c8:b0:3e5:5e88:72aa with SMTP id e9e14a558f8ab-3e5674a5784mr4635165ab.5.1755038228596; Tue, 12 Aug 2025 15:37:08 -0700 (PDT) Received: from kf-m2g5 ([2607:fb91:1183:972:c716:b21c:e9a1:44a4]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-50ae9c88892sm3214579173.86.2025.08.12.15.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Aug 2025 15:37:08 -0700 (PDT) Date: Tue, 12 Aug 2025 17:36:58 -0500 From: Aaron Rainbolt To: "Vladimir 'phcoder' Serbinenko" Cc: The development of GNU GRUB Subject: Re: [PATCH v4 1/2] include/xen: Rename MAX_GUEST_CMDLINE to GRUB_XEN_MAX_GUEST_CMDLINE Message-ID: <20250812173658.4a3f4849@kf-m2g5> In-Reply-To: References: <20250804234816.3d14f53f@kf-m2g5> <20250804234911.3cc3997c@kf-m2g5> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::135; envelope-from=arraybolt3@gmail.com; helo=mail-il1-x135.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Content-Type: multipart/mixed; boundary="===============4951045290712788186==" Errors-To: grub-devel-bounces+grub-devel=archiver.kernel.org@gnu.org Sender: grub-devel-bounces+grub-devel=archiver.kernel.org@gnu.org --===============4951045290712788186== Content-Type: multipart/signed; boundary="Sig_/1lxNzkPAP03diNimiSMZqWL"; protocol="application/pgp-signature"; micalg=pgp-sha512 --Sig_/1lxNzkPAP03diNimiSMZqWL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 12 Aug 2025 16:00:05 +0300 "Vladimir 'phcoder' Serbinenko" wrote: > I believe this file is copied from xen as-is. It does appear so, yes. It looks like it's a copy of xen/xen/include/public/xen.h. > That's why it's under xen/ and not grub/. Did you encounter actual > conflicts? I did not, but Daniel requested I rename the define since it was too generic previously. > What does a new version of xen.h from xen says? It's pretty similar, with most but not all of the changes being comment-only. A unified diff between the version in the tip of GRUB's master branch and the version in the tip of Xen's stable-4.20 branch is provided below. [1] -- Aaron > Regards > Vladimir 'phcoder' Serbinenko >=20 > Le mar. 5 ao=C3=BBt 2025, 07:49, Aaron Rainbolt a > =C3=A9crit : >=20 > > The xen.h header was using an overly generic name to refer to the > > maximum length of the command line passed from Xen to a guest. > > Rename it to avoid confusion or conflicts in the future. > > > > Signed-off-by: Aaron Rainbolt > > --- > > include/xen/xen.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/include/xen/xen.h b/include/xen/xen.h > > index 692f97a..fdf0fc4 100644 > > --- a/include/xen/xen.h > > +++ b/include/xen/xen.h > > @@ -823,8 +823,8 @@ struct start_info { > > /* (PFN of pre-loaded module if > > */ > > /* SIF_MOD_START_PFN set in > > flags). */ > > unsigned long mod_len; /* Size (bytes) of pre-loaded > > module. */ > > -#define MAX_GUEST_CMDLINE 1024 > > - int8_t cmd_line[MAX_GUEST_CMDLINE]; > > +#define GRUB_XEN_MAX_GUEST_CMDLINE 1024 > > + int8_t cmd_line[GRUB_XEN_MAX_GUEST_CMDLINE]; > > /* The pfn range here covers both page table and p->m table > > frames. */ > > unsigned long first_p2m_pfn;/* 1st pfn forming initial P->M > > table. */ > > unsigned long nr_p2m_frames;/* # of pfns forming initial P->M > > table. */ > > -- > > 2.50.1 > > > > _______________________________________________ > > Grub-devel mailing list > > Grub-devel@gnu.org > > https://lists.gnu.org/mailman/listinfo/grub-devel > > =20 [1] The diff mentioned above: --- grub/include/xen/xen.h 2025-08-12 17:33:48.086097055 -0500 +++ xen/xen/include/public/xen.h 2025-08-12 17:11:01.399108823 -0500 @@ -1,26 +1,9 @@ +/* SPDX-License-Identifier: MIT */ /*************************************************************************= ***** * xen.h * * Guest OS interface to Xen. * - * Permission is hereby granted, free of charge, to any person obtaining a= copy - * of this software and associated documentation files (the "Software"), to - * deal in the Software without restriction, including without limitation = the - * rights to use, copy, modify, merge, publish, distribute, sublicense, an= d/or - * sell copies of the Software, and to permit persons to whom the Software= is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included= in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL= THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * * Copyright (c) 2004, K A Fraser */ =20 @@ -33,6 +16,10 @@ #include "arch-x86/xen.h" #elif defined(__arm__) || defined (__aarch64__) #include "arch-arm.h" +#elif defined(__powerpc64__) +#include "arch-ppc.h" +#elif defined(__riscv) +#include "arch-riscv.h" #else #error "Unsupported architecture" #endif @@ -53,6 +40,15 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t); DEFINE_XEN_GUEST_HANDLE(xen_ulong_t); =20 +/* Define a variable length array (depends on compiler). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >=3D 199901L +#define XEN_FLEX_ARRAY_DIM +#elif defined(__GNUC__) +#define XEN_FLEX_ARRAY_DIM 0 +#else +#define XEN_FLEX_ARRAY_DIM 1 /* variable size */ +#endif + /* Turn a plain number into a C unsigned (long (long)) constant. */ #define __xen_mk_uint(x) x ## U #define __xen_mk_ulong(x) x ## UL @@ -118,9 +114,10 @@ #define __HYPERVISOR_domctl 36 #define __HYPERVISOR_kexec_op 37 #define __HYPERVISOR_tmem_op 38 -#define __HYPERVISOR_xc_reserved_op 39 /* reserved for XenClient */ +#define __HYPERVISOR_argo_op 39 #define __HYPERVISOR_xenpmu_op 40 #define __HYPERVISOR_dm_op 41 +#define __HYPERVISOR_hypfs_op 42 =20 /* Architecture-specific hypercall definitions. */ #define __HYPERVISOR_arch_0 48 @@ -177,8 +174,8 @@ #define VIRQ_XENOPROF 7 /* V. XenOprofile interrupt: new sample availab= le */ #define VIRQ_CON_RING 8 /* G. (DOM0) Bytes received on console = */ #define VIRQ_PCPU_STATE 9 /* G. (DOM0) PCPU state changed = */ -#define VIRQ_MEM_EVENT 10 /* G. (DOM0) A memory event has occured = */ -#define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient = */ +#define VIRQ_MEM_EVENT 10 /* G. (DOM0) A memory event has occurred = */ +#define VIRQ_ARGO 11 /* G. Argo interdomain message notification = */ #define VIRQ_ENOMEM 12 /* G. (DOM0) Low on heap memory */ #define VIRQ_XENPMU 13 /* V. PMC interrupt = */ =20 @@ -268,6 +265,10 @@ * As MMU_NORMAL_PT_UPDATE above, but A/D bits currently in the PTE are OR= ed * with those in @val. * + * ptr[1:0] =3D=3D MMU_PT_UPDATE_NO_TRANSLATE: + * As MMU_NORMAL_PT_UPDATE above, but @val is not translated though FD + * page tables. + * * @val is usually the machine frame number along with some attributes. * The attributes by default follow the architecture defined bits. Meaning= that * if this is a X86_64 machine and four page table layout is used, the lay= out @@ -334,9 +335,11 @@ * * PAT (bit 7 on) --> PWT (bit 3 on) and clear bit 7. */ -#define MMU_NORMAL_PT_UPDATE 0 /* checked '*ptr =3D val'. ptr is MA. = */ -#define MMU_MACHPHYS_UPDATE 1 /* ptr =3D MA of frame to modify entry= for */ -#define MMU_PT_UPDATE_PRESERVE_AD 2 /* atomically: *ptr =3D val | (*ptr&(A= |D)) */ +#define MMU_NORMAL_PT_UPDATE 0 /* checked '*ptr =3D val'. ptr is MA.= */ +#define MMU_MACHPHYS_UPDATE 1 /* ptr =3D MA of frame to modify entr= y for */ +#define MMU_PT_UPDATE_PRESERVE_AD 2 /* atomically: *ptr =3D val | (*ptr&(= A|D)) */ +#define MMU_PT_UPDATE_NO_TRANSLATE 3 /* checked '*ptr =3D val'. ptr is MA.= */ + /* val never translated. = */ =20 /* * MMU EXTENDED OPERATIONS @@ -480,7 +483,28 @@ /* ` } */ =20 /* - * Commands to HYPERVISOR_console_io(). + * ` int + * ` HYPERVISOR_console_io(unsigned int cmd, + * ` unsigned int count, + * ` char buffer[]); + * + * @cmd: Command (see below) + * @count: Size of the buffer to read/write + * @buffer: Pointer in the guest memory + * + * List of commands: + * + * * CONSOLEIO_write: Write the buffer to Xen console. + * For the hardware domain, all the characters in the buffer will + * be written. Characters will be printed directly to the console. + * For all the other domains, only the printable characters will be + * written. Characters may be buffered until a newline (i.e '\n') is + * found. + * @return 0 on success, otherwise return an error code. + * * CONSOLEIO_read: Attempts to read up to @count characters from Xen + * console. The maximum buffer size (i.e. @count) supported is 2GB. + * @return the number of characters read on success, otherwise return + * an error code. */ #define CONSOLEIO_write 0 #define CONSOLEIO_read 1 @@ -578,6 +602,9 @@ /* Idle domain. */ #define DOMID_IDLE xen_mk_uint(0x7FFF) =20 +/* Mask for valid domain id values */ +#define DOMID_MASK xen_mk_uint(0x7FFF) + #ifndef __ASSEMBLY__ =20 typedef uint16_t domid_t; @@ -596,7 +623,7 @@ /* * ` enum neg_errnoval * ` HYPERVISOR_multicall(multicall_entry_t call_list[], - * ` uint32_t nr_calls); + * ` unsigned long nr_calls); * * NB. The fields are logically the natural register size for this * architecture. In cases where xen_ulong_t is larger than this then @@ -686,7 +713,7 @@ #endif /* XEN_HAVE_PV_UPCALL_MASK */ xen_ulong_t evtchn_pending_sel; struct arch_vcpu_info arch; - struct vcpu_time_info time; + vcpu_time_info_t time; }; /* 64 bytes (x86) */ #ifndef __XEN__ typedef struct vcpu_info vcpu_info_t; @@ -739,12 +766,17 @@ xen_ulong_t evtchn_mask[sizeof(xen_ulong_t) * 8]; =20 /* - * Wallclock time: updated only by control software. Guests should base - * their gettimeofday() syscall on this wallclock-base value. + * Wallclock time: updated by control software or RTC emulation. + * Guests should base their gettimeofday() syscall on this + * wallclock-base value. + * The values of wc_sec and wc_nsec are offsets from the Unix epoch + * adjusted by the domain's 'time offset' (in seconds) as set either + * by XEN_DOMCTL_settimeoffset, or adjusted via a guest write to the + * emulated RTC. */ uint32_t wc_version; /* Version counter: see vcpu_time_info_t. */ - uint32_t wc_sec; /* Secs 00:00:00 UTC, Jan 1, 1970. */ - uint32_t wc_nsec; /* Nsecs 00:00:00 UTC, Jan 1, 1970. */ + uint32_t wc_sec; + uint32_t wc_nsec; #if !defined(__i386__) uint32_t wc_sec_hi; # define xen_wc_sec_hi wc_sec_hi @@ -916,6 +948,11 @@ uint32_t gbl_caps; /* Mode attributes (offset 0x0, VESA command 0x4f01). */ uint16_t mode_attrs; + uint16_t pad; +#endif +#if __XEN_INTERFACE_VERSION__ >=3D 0x00040d00 + /* high 32 bits of lfb_base */ + uint32_t ext_lfb_base; #endif } vesa_lfb; } u; @@ -981,6 +1018,7 @@ XEN_GUEST_HANDLE_64(uint8) bitmap; uint32_t nr_bits; }; +typedef struct xenctl_bitmap xenctl_bitmap_t; #endif =20 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */ --Sig_/1lxNzkPAP03diNimiSMZqWL Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEudh48PFXwyPDa0wGpwkWDXPHkQkFAmibwgoACgkQpwkWDXPH kQm28g//ZYTVEE2onuNc0n7IFri921DYiu1KvDp95V1ozPrRWYtqSEZA8eEt9pF+ U75OrLeDfzndBDnrLksA8Jxri6BkA2a9Me9CHmQqDLZPI/ZZ0b0xD5Hr1J1H3aJZ 9XPmB063xAS2qLlqqCNOLg7V6JlLTBpSNi0JBt3sRyLMIOAwUO1xOnj3kgW3HLfk wvEwtI8pQ3IlfeBdZOrsMvg6zk41IHB7VPGRZ5BpeLqpMjbXH5ID6QragRRAHJzS x94Hkk1ctEh48ntFVPjx1ZIMqIhKX1vS0BV/QC0J0y7c/APZrLMFv0vwnRF9ILw5 l77ixlmKEcfqd/EtXOi8Oxqv3j32TdXlL5c6Lq7Y+o1Sa0KBSiPE9RaUv9ApQfGT noYMUwl14LbzY3K9eWs9atIIlkDqJodNQkEbNH9oqn5HqDOcrjXg0lLvmmILc17Z NvAXIqTN5dTVDvqQHddgiQVSYMOCywff3AdcJmKmFKG2dtDq38duY8uUOvGtfo1P k+XaXgP+8HB4iD1MrceEkKNugQ06N0AQRiqqnjiV2CpTKOtdc+P3pdYscEQiV5pG sR5VNiyXYZ1pIwM/r43eMiP8knk9dAXcI3sHGPD1EwgHRj4iO0dJtNYFIZumG1A9 BgkrDvapsWapNeaQZz7lw+HuwMqeayLFbZKmO9uAtyjgs4kaO+8= =PLOr -----END PGP SIGNATURE----- --Sig_/1lxNzkPAP03diNimiSMZqWL-- --===============4951045290712788186== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KR3J1Yi1kZXZl bCBtYWlsaW5nIGxpc3QKR3J1Yi1kZXZlbEBnbnUub3JnCmh0dHBzOi8vbGlzdHMuZ251Lm9yZy9t YWlsbWFuL2xpc3RpbmZvL2dydWItZGV2ZWwK --===============4951045290712788186==--