qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Fix the build on CentOS 7
@ 2023-08-10 21:51 Ilya Leoshkevich
  2023-08-10 21:51 ` [PATCH 1/3] linux-user: Fix the build on systems without SOL_ALG Ilya Leoshkevich
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ilya Leoshkevich @ 2023-08-10 21:51 UTC (permalink / raw)
  To: Laurent Vivier, Richard Henderson; +Cc: qemu-devel, Ilya Leoshkevich

Hi,

I know that CentOS 7 is not tested anymore, but unfortunately it's the
only ppc64le system that I have, so I had to fix a few build issues
that crept in since the testing stopped. The fixes are simple and may
be helpful to people in the same situation.

Best regards,
Ilya

Ilya Leoshkevich (3):
  linux-user: Fix the build on systems without SOL_ALG
  linux-user: Fix the build on systems without MAP_SHARED_VALIDATE
  linux-user: Fix the build on systems without MADV_{KEEP,WIPE}ONFORK

 linux-user/mmap.c    | 1 +
 linux-user/syscall.c | 3 +++
 2 files changed, 4 insertions(+)

-- 
2.41.0



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] linux-user: Fix the build on systems without SOL_ALG
  2023-08-10 21:51 [PATCH 0/3] Fix the build on CentOS 7 Ilya Leoshkevich
@ 2023-08-10 21:51 ` Ilya Leoshkevich
  2023-08-11 14:11   ` Philippe Mathieu-Daudé
  2023-08-10 21:51 ` [PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE Ilya Leoshkevich
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Ilya Leoshkevich @ 2023-08-10 21:51 UTC (permalink / raw)
  To: Laurent Vivier, Richard Henderson; +Cc: qemu-devel, Ilya Leoshkevich

Building QEMU on CentOS 7 fails, because there SOL_ALG is not defined.
There already exists #if defined(SOL_ALG) in do_setsockopt(); add it to
target_to_host_cmsg() as well.

Fixes: 27404b6c15c1 ("linux-user: Implement SOL_ALG encryption support")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 linux-user/syscall.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 18d3107194b..42f4aed8e84 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1806,6 +1806,7 @@ static inline abi_long target_to_host_cmsg(struct msghdr *msgh,
             __get_user(cred->pid, &target_cred->pid);
             __get_user(cred->uid, &target_cred->uid);
             __get_user(cred->gid, &target_cred->gid);
+#ifdef SOL_ALG
         } else if (cmsg->cmsg_level == SOL_ALG) {
             uint32_t *dst = (uint32_t *)data;
 
@@ -1814,6 +1815,7 @@ static inline abi_long target_to_host_cmsg(struct msghdr *msgh,
             if (len >= sizeof(uint32_t)) {
                 *dst = tswap32(*dst);
             }
+#endif
         } else {
             qemu_log_mask(LOG_UNIMP, "Unsupported ancillary data: %d/%d\n",
                           cmsg->cmsg_level, cmsg->cmsg_type);
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE
  2023-08-10 21:51 [PATCH 0/3] Fix the build on CentOS 7 Ilya Leoshkevich
  2023-08-10 21:51 ` [PATCH 1/3] linux-user: Fix the build on systems without SOL_ALG Ilya Leoshkevich
@ 2023-08-10 21:51 ` Ilya Leoshkevich
  2023-08-10 22:03   ` Helge Deller
  2023-08-10 21:51 ` [PATCH 3/3] linux-user: Fix the build on systems without MADV_{KEEP, WIPE}ONFORK Ilya Leoshkevich
  2023-08-17 11:03 ` [PATCH 0/3] Fix the build on CentOS 7 Daniel P. Berrangé
  3 siblings, 1 reply; 8+ messages in thread
From: Ilya Leoshkevich @ 2023-08-10 21:51 UTC (permalink / raw)
  To: Laurent Vivier, Richard Henderson; +Cc: qemu-devel, Ilya Leoshkevich

CentOS 7 does not define MAP_SHARED_VALIDATE. Use a definition provided
by the QEMU's copy of linux/mman.h.

Fixes: 4b840f96096d ("linux-user: Populate more bits in mmap_flags_tbl")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 42f4aed8e84..256f38cdd5d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -121,6 +121,7 @@
 #ifdef HAVE_BTRFS_H
 #include <linux/btrfs.h>
 #endif
+#include <linux/mman.h>
 #ifdef HAVE_DRM_H
 #include <libdrm/drm.h>
 #include <libdrm/i915_drm.h>
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] linux-user: Fix the build on systems without MADV_{KEEP, WIPE}ONFORK
  2023-08-10 21:51 [PATCH 0/3] Fix the build on CentOS 7 Ilya Leoshkevich
  2023-08-10 21:51 ` [PATCH 1/3] linux-user: Fix the build on systems without SOL_ALG Ilya Leoshkevich
  2023-08-10 21:51 ` [PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE Ilya Leoshkevich
@ 2023-08-10 21:51 ` Ilya Leoshkevich
  2023-08-17 11:03 ` [PATCH 0/3] Fix the build on CentOS 7 Daniel P. Berrangé
  3 siblings, 0 replies; 8+ messages in thread
From: Ilya Leoshkevich @ 2023-08-10 21:51 UTC (permalink / raw)
  To: Laurent Vivier, Richard Henderson; +Cc: qemu-devel, Ilya Leoshkevich

CentOS 7 does not define MADV_KEEPONFORK and MADV_WIPEONFORK. Use
definitions provided by the QEMU's copy of linux/mman.h.

Fixes: 4530deb1 ("linux-user: Add emulation for MADV_WIPEONFORK and MADV_KEEPONFORK in madvise()")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 linux-user/mmap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 9aab48d4a30..127962c1c26 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -17,6 +17,7 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include <linux/mman.h>
 #include "trace.h"
 #include "exec/log.h"
 #include "qemu.h"
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE
  2023-08-10 21:51 ` [PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE Ilya Leoshkevich
@ 2023-08-10 22:03   ` Helge Deller
  2023-08-10 22:13     ` Ilya Leoshkevich
  0 siblings, 1 reply; 8+ messages in thread
From: Helge Deller @ 2023-08-10 22:03 UTC (permalink / raw)
  To: Ilya Leoshkevich, Laurent Vivier, Richard Henderson
  Cc: qemu-devel, Markus F.X.J. Oberhumer

On 8/10/23 23:51, Ilya Leoshkevich wrote:
> CentOS 7 does not define MAP_SHARED_VALIDATE. Use a definition provided
> by the QEMU's copy of linux/mman.h.
>
> Fixes: 4b840f96096d ("linux-user: Populate more bits in mmap_flags_tbl")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>

Does it fix the missing MADV_WIPEONFORK as well?
https://gitlab.com/qemu-project/qemu/-/issues/1824#note_1507837354

Helge

> ---
>   linux-user/syscall.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 42f4aed8e84..256f38cdd5d 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -121,6 +121,7 @@
>   #ifdef HAVE_BTRFS_H
>   #include <linux/btrfs.h>
>   #endif
> +#include <linux/mman.h>
>   #ifdef HAVE_DRM_H
>   #include <libdrm/drm.h>
>   #include <libdrm/i915_drm.h>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE
  2023-08-10 22:03   ` Helge Deller
@ 2023-08-10 22:13     ` Ilya Leoshkevich
  0 siblings, 0 replies; 8+ messages in thread
From: Ilya Leoshkevich @ 2023-08-10 22:13 UTC (permalink / raw)
  To: Helge Deller, Laurent Vivier, Richard Henderson
  Cc: qemu-devel, Markus F.X.J. Oberhumer

On Fri, 2023-08-11 at 00:03 +0200, Helge Deller wrote:
> On 8/10/23 23:51, Ilya Leoshkevich wrote:
> > CentOS 7 does not define MAP_SHARED_VALIDATE. Use a definition
> > provided
> > by the QEMU's copy of linux/mman.h.
> > 
> > Fixes: 4b840f96096d ("linux-user: Populate more bits in
> > mmap_flags_tbl")
> > Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> 
> Does it fix the missing MADV_WIPEONFORK as well?
> https://gitlab.com/qemu-project/qemu/-/issues/1824#note_1507837354
> 
> Helge

What a coincidence, that multiple people ran into this on the same day.

This should be fixed by [3/3] of this series.

Best regards,
Ilya


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] linux-user: Fix the build on systems without SOL_ALG
  2023-08-10 21:51 ` [PATCH 1/3] linux-user: Fix the build on systems without SOL_ALG Ilya Leoshkevich
@ 2023-08-11 14:11   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-08-11 14:11 UTC (permalink / raw)
  To: Ilya Leoshkevich, Laurent Vivier, Richard Henderson; +Cc: qemu-devel

On 10/8/23 23:51, Ilya Leoshkevich wrote:
> Building QEMU on CentOS 7 fails, because there SOL_ALG is not defined.
> There already exists #if defined(SOL_ALG) in do_setsockopt(); add it to
> target_to_host_cmsg() as well.

Does including "crypto/afalgpriv.h" help?

> Fixes: 27404b6c15c1 ("linux-user: Implement SOL_ALG encryption support")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>   linux-user/syscall.c | 2 ++
>   1 file changed, 2 insertions(+)




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] Fix the build on CentOS 7
  2023-08-10 21:51 [PATCH 0/3] Fix the build on CentOS 7 Ilya Leoshkevich
                   ` (2 preceding siblings ...)
  2023-08-10 21:51 ` [PATCH 3/3] linux-user: Fix the build on systems without MADV_{KEEP, WIPE}ONFORK Ilya Leoshkevich
@ 2023-08-17 11:03 ` Daniel P. Berrangé
  3 siblings, 0 replies; 8+ messages in thread
From: Daniel P. Berrangé @ 2023-08-17 11:03 UTC (permalink / raw)
  To: Ilya Leoshkevich; +Cc: Laurent Vivier, Richard Henderson, qemu-devel

On Thu, Aug 10, 2023 at 11:51:30PM +0200, Ilya Leoshkevich wrote:
> Hi,
> 
> I know that CentOS 7 is not tested anymore, but unfortunately it's the
> only ppc64le system that I have, so I had to fix a few build issues
> that crept in since the testing stopped. The fixes are simple and may
> be helpful to people in the same situation.

Actually it is more than not tested. CentOS 7 is explicitly
unsupported per our platform support matrix:

https://www.qemu.org/docs/master/about/build-platforms.html

and thus we will *intentionally* delete backwards compatibility code
that it needs, in order to simplify QEMU's codebase.

> Ilya Leoshkevich (3):
>   linux-user: Fix the build on systems without SOL_ALG
>   linux-user: Fix the build on systems without MAP_SHARED_VALIDATE
>   linux-user: Fix the build on systems without MADV_{KEEP,WIPE}ONFORK

We explicitly do NOT want to add this kind of back compat code
for unsupported platforms.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-08-17 11:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-10 21:51 [PATCH 0/3] Fix the build on CentOS 7 Ilya Leoshkevich
2023-08-10 21:51 ` [PATCH 1/3] linux-user: Fix the build on systems without SOL_ALG Ilya Leoshkevich
2023-08-11 14:11   ` Philippe Mathieu-Daudé
2023-08-10 21:51 ` [PATCH 2/3] linux-user: Fix the build on systems without MAP_SHARED_VALIDATE Ilya Leoshkevich
2023-08-10 22:03   ` Helge Deller
2023-08-10 22:13     ` Ilya Leoshkevich
2023-08-10 21:51 ` [PATCH 3/3] linux-user: Fix the build on systems without MADV_{KEEP, WIPE}ONFORK Ilya Leoshkevich
2023-08-17 11:03 ` [PATCH 0/3] Fix the build on CentOS 7 Daniel P. Berrangé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).