cmpxchg_guest_abs_with_key(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ cmpxchg_guest_abs_with_key(9) πŸ¦‹

okay bestie, welcome to the Kernel API Manual entry for cmpxchg_guest_abs_with_key β€” yes, the name is a mouthful, but we’re gonna make it make sense. πŸ’–

🌸 NAME 🌸

cmpxchg_guest_abs_with_key β€” perform cmpxchg on guest absolute address. it’s giving β€œatomic compare-and-exchange, but for a guest absolute address,” and honestly? iconic. ✨

πŸŽ€ SYNOPSIS πŸŽ€

int cmpxchg_guest_abs_with_key (struct kvm *kvm , gpa_t gpa , int len ,
union kvm_s390_quad *old , union kvm_s390_quad new , u8 acc , bool
*success );

✨ ARGUMENTS ✨

  • kvm β€” virtual machine instance. πŸ’»
  • gpa β€” absolute guest address of the location to be changed. πŸ“
  • len β€” operand length of the cmpxchg. required: 1 <= len <= 16. providing a non power of two will result in failure. 🚨
  • old β€” pointer to old value. if the location at gpa contains this value, the exchange will succeed. after calling cmpxchg_guest_abs_with_key, *old contains the value at gpa before the attempt to exchange the value. 🫢
  • new β€” the value to place at gpa. 🌟
  • acc β€” the access key to use for the guest access. πŸ”‘
  • success β€” output value indicating if an exchange occurred. βœ…

πŸ’… DESCRIPTION πŸ’…

atomically exchange the value at gpa by new, if it contains *old. it honors storage keys. periodt. πŸ”₯

🌈 RETURN 🌈

  • 0: successful exchange
  • >0: a program interruption code indicating the reason cmpxchg could not be attempted
  • -EINVAL: address misaligned or len not power of two
  • -EAGAIN: transient failure (len 1 or 2)
  • -EOPNOTSUPP: read-only memslot (should never occur)

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./arch/s390/kvm/s390/gaccess.c β€” the main character β€” plus the whole crew:

mwah πŸ’‹ β€” this page’s source/version is ./arch/s390/kvm/s390, dated October 2026, page cmpxchg_guest_abs_with_key(9). that’s the footer, bestie, now go be iconic. πŸ’œ

πŸ“¦ where this page comes from